W dokumentacji modemu Sierra Wireless komendy AT są fajnie opisane ale nie potrafię rozkminić tej:
Configure support for GPS positioning modes
Enable or disable support for several GPS positioning modes.
Note: !RESET must be issued after this command is used.
Password required: Yes
Usage:
• Execution: AT!GPSPOSMODE=<mask>
Response: OK
or ERROR
Purpose: Use a single byte hexadecimal format mask to indicate which GPS
positioning modes are to be supported.
• Query: AT!GPSPOSMODE?
Response: MASK: <mask>
OK
Purpose: Return a <mask> value indicating which GPS positioning modes
are currently supported.
• Query List: AT!GPSPOSMODE=?
Purpose: Return supported <mask> values.
Parameters:
<mask> (Bitmap value representing supported GPS positioning modes)
• 1-byte hex format mask (do not include ‘0x’ before the mask value)
• ‘On’ bits identify modes that are supported
• Bit 0: Standalone
• Bit 1: UP MS-based
• Bit 2: UP MS-assisted
• Bit 3: CP MS-based (2G)
• Bit 4: CP MS-assisted (2G)
• Bit 5: CP UE-based (3G)
• Bit 6: CP UE-assisted (3G)
• Bit 7: Unused
Example:
AT!GPSPOSMODE=2a enables support for Bit 5 (CP UE-based), Bit 3 (CP MS-
based), and Bit 1 (UP MS-based)
Jak mam ustawić AT!GPSPOSMODE żebym miał włączone Bit 0, Bit 1 i Bit 2 ?
Tak.
A jak wszystko inne zawiedzie, to większość shelli (a na pewno bash i zsh) ma wbudowane polecenie printf zachowujące się jak odpowiednik w C (http://www.cplusplus.com/reference/cstdio/printf/), plus rozumiejące przedrostek 0b jako liczbę binarną:
╭─╴~╶────────────────────────────────────────╴Linux 4.15.0-36-generic x86_64╶─╮
╰─╴pawel@i7 > which printf
printf: shell built-in command
╭─╴~╶────────────────────────────────────────╴Linux 4.15.0-36-generic x86_64╶─╮
╰─╴pawel@i7 > printf '%02x\n' 0b01111111
7f