Application protocol

Product Data Protocol

class pygarmin.protocol.A000(linkLayer)

Bases: object

Product Data Protocol.

The Product Data Protocol is used to determine the product data of the connected device, which enables the host to determine the protocols and data types supported by the device.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Host to Device

pid_product_rqst

ignored

1

Device to Host

pid_product_data

ProductData

2

Device to Host

pid_ext_product_data

ExtProductData

n-1

Device to Host

pid_ext_product_data

ExtProductData

class pygarmin.protocol.A001(linkLayer)

Bases: object

Protocol capabilities protocol.

The Protocol Capability Protocol is used by the device to report the protocols and data types it supports. When this protocol is supported, it will send a list of all supported protocols and data types after completion of the A000 Product Data Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device to Host

pid_protocol_array

ProtocolArray

Command Protocol

class pygarmin.protocol.A010(gps)

Bases: CommandProtocol

Device Command Protocol 1.

This Device Command Protocol is used by most devices.

class pygarmin.protocol.A011(gps)

Bases: CommandProtocol

Device command protocol 2.

This Device Command Protocol is used by panel-mounted aviation devices.

Transfer protocol

class pygarmin.protocol.A100(gps, datatypes)

Bases: TransferProtocol

Waypoint Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_records

Records

1

Device1 to Device2

pid_wpt_data

<D0>

2

Device1 to Device2

pid_wpt_data

<D0>

n-2

Device1 to Device2

pid_wpt_data

<D0>

n-1

Device1 to Device2

pid_xfer_cmplt

Command

class pygarmin.protocol.A101(gps, datatypes)

Bases: TransferProtocol

Waypoint Category Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_records

Records

1

Device1 to Device2

pid_wpt_cat

<D0>

2

Device1 to Device2

pid_wpt_cat

<D0>

n-2

Device1 to Device2

pid_wpt_cat

<D0>

n-1

Device1 to Device2

pid_xfer_cmplt

Command

class pygarmin.protocol.A200(gps, datatypes)

Bases: TransferProtocol

Route Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_records

Records

1

Device1 to Device2

pid_rte_hdr

<D0>

2

Device1 to Device2

pid_rte_wpt_data

<D1>

3

Device1 to Device2

pid_rte_wpt_data

<D1>

n-2

Device1 to Device2

pid_rte_wpt_data

<D1>

n-1

Device1 to Device2

pid_xfer_cmplt

Command

class pygarmin.protocol.A201(gps, datatypes)

Bases: TransferProtocol

Route Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_records

Records

1

Device1 to Device2

pid_rte_hdr

<D0>

2

Device1 to Device2

pid_rte_wpt_data

<D1>

3

Device1 to Device2

pid_rte_link_data

<D2>

4

Device1 to Device2

pid_rte_wpt_data

<D1>

5

Device1 to Device2

pid_rte_link_data

<D2>

n-2

Device1 to Device2

pid_rte_wpt_data

<D1>

n-1

Device1 to Device2

pid_xfer_cmplt

Command

class pygarmin.protocol.A300(gps, datatypes)

Bases: TransferProtocol

Track Log Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_records

Records

1

Device1 to Device2

pid_trk_data

<D0>

2

Device1 to Device2

pid_trk_data

<D0>

n-2

Device1 to Device2

pid_trk_data

<D0>

n-1

Device1 to Device2

pid_xfer_cmplt

Command

class pygarmin.protocol.A301(gps, datatypes)

Bases: TransferProtocol

Track Log Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_records

Records

1

Device1 to Device2

pid_trk_hdr

<D0>

2

Device1 to Device2

pid_trk_data

<D1>

3

Device1 to Device2

pid_trk_data

<D1>

n-2

Device1 to Device2

pid_trk_data

<D1>

n-1

Device1 to Device2

pid_xfer_cmplt

Command

class pygarmin.protocol.A302(gps, datatypes)

Bases: A301

Track Log Transfer Protocol.

The A302 Track Log Transfer Protocol is used in fitness devices to transfer tracks from the device to the Host. The packet sequence for the protocol is identical to A301, except that the Host may only receive tracks from the device, and not send them.

class pygarmin.protocol.A400(gps, datatypes)

Bases: TransferProtocol

Proximity Waypoint Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_records

Records

1

Device1 to Device2

pid_prx_wpt_data

<D0>

2

Device1 to Device2

pid_prx_wpt_data

<D0>

n-2

Device1 to Device2

pid_prx_wpt_data

<D0>

n-1

Device1 to Device2

pid_xfer_cmplt

Command

class pygarmin.protocol.A500(gps, datatypes)

Bases: TransferProtocol

Almanac Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_records

Records

1

Device1 to Device2

pid_almanac_data

<D0>

2

Device1 to Device2

pid_almanac_data

<D0>

n-2

Device1 to Device2

pid_almanac_data

<D0>

n-1

Device1 to Device2

pid_xfer_cmplt

Command

Some device-specific data types do not include a satellite ID to relate each data packet to a particular satellite in the GPS constellation. For these data types, the order of the 32 pid_almanac_data packets corresponds to PRN order (i.e., the first packet contains data for PRN-01 and so on up to PRN-32).

class pygarmin.protocol.A600(gps, datatypes)

Bases: TransferProtocol

Date and Time Initialization Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_date_time_data

<D0>

class pygarmin.protocol.A601(gps, datatypes)

Bases: TransferProtocol

Undocumented application protocol.

class pygarmin.protocol.A650(gps, datatypes)

Bases: TransferProtocol

Flightbook Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Host to Device

pid_command_data

Command

1

Device to Host

pid_records

Records

2

Device to Host

pid_flightbook_record

<D0>

n-2

Device to Host

pid_flightbook_record

<D0>

n-1

Device to Host

pid_xfer_cmplt

Command

class pygarmin.protocol.A700(gps, datatypes)

Bases: TransferProtocol

Position initialisation protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_position_data

<D0>

class pygarmin.protocol.A800(gps, datatypes)

Bases: TransferProtocol

PVT Data Protocol.

In PVT mode the device will transmit packets once per second with real-time position, velocity, and time. This protocol is used as an alternative to NMEA (https://www.nmea.org/content/STANDARDS/STANDARDS).

PVT mode can be switched on and off by sending the cmnd_start_pvt_data and cmnd_stop_pvt_data command.

According to the specification the ACK and NAK packets are optional, but the device will not retransmit a PVT packet in response to receiving a NAK.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device to Host (ACK/NAK optional)

pid_pvt_data

<D0>

The Garmin Forerunner 305 only reports the D800 datatype, but in practice transmits the D800 and an undocumented Satellite datatype alternately.

class pygarmin.protocol.A801

Bases: object

Undocumented application protocol.

class pygarmin.protocol.A802

Bases: object

Undocumented application protocol.

class pygarmin.protocol.A900(gps)

Bases: object

Map transfer protocol.

This protocol is undocumented, but it appears to be a map transfer protocol. The implementation is derived from the GarminDev drivers of the abandoned QLandkarteGT application (https://sourceforge.net/projects/qlandkartegt/) and the sendmap application included with the also abandoned cGPSmapper application (https://sourceforge.net/projects/cgpsmapper/).

On devices without mass storage mode, maps are stored in the internal flash memory of the device. Some of the memory regions are:

Region

Hex

Map Name

Filename

3

0x03

Device Base Map

gmapbmap.img

10

0x0a

Supplementary map

gmapsupp.img

14

0x0e

Firmware/System Software

fw_all.bin

16

0x10

Logo/Splash Screen

logo.bin

49

0x31

Primary or Pre Installed Map

gmapprom.img

50

0x32

OEM Installed Map

gmapoem.img

These regions are derived from the Garmin RGN firmware update file format (confusingly, the RGN subfiles within Garmin IMG files share the same name, but have a completely different structure and purpose). The file format is reverse engineered by Herbert Oppmann (https://www.memotech.franken.de/FileFormats/Garmin_RGN_Format.pdf). This protocol only seems to be able to access region 10 with the supplementary map.

The terminology of the commands below is taken from SPI interfaces for serial flash memory that are used elsewhere. Before any write operation, the write enable command WREN must be issued. Sending the WREN sets the internal write enable latch, which is indicated by the WEL response. The write disable command WRDI clears it.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Host to Device

pid_mem_wren

Region

1

Device to Host

pid_mem_wel

2

Device to Host

pid_mem_write

MemChunk

n-2

Device to Host

pid_mem_write

MemChunk

n-1

Device to Host

pid_mem_wrdi

Region

class pygarmin.protocol.A902(gps)

Bases: object

Map unlock protocol.

This protocol is undocumented, but it appears to be a map unlock protocol. The implementation is derived from the GarminDev drivers of the abandoned QLandkarteGT application (https://sourceforge.net/projects/qlandkartegt/) and the also abandoned sendmap application included with the cGPSmapper application (https://sourceforge.net/projects/cgpsmapper/).

class pygarmin.protocol.A903

Bases: object

Undocumented application protocol.

class pygarmin.protocol.A904

Bases: object

Undocumented application protocol

This protocol is undocumented, but it appears to be a routable protocol. No implementation as of yet.

class pygarmin.protocol.A905(gps, datatypes)

Bases: TransferProtocol

Undocumented application protocol

This protocol is undocumented, but it is called an unlock code communication protocol in the changelogs of the Garmin eTrex Legend Cx/Vista Cx/Venture Cx/Venture HC, and the Garmin GPSMAP 60Cx/60CSx/76Cx/76CSx. No implementation as of yet.

class pygarmin.protocol.A906(gps, datatypes)

Bases: TransferProtocol

Lap Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device to Host

pid_records

Records

1

Device to Host

pid_lap

<D0>

2

Device to Host

pid_lap

<D0>

n-2

Device to Host

pid_lap

<D0>

n-1

Device to Host

pid_xfer_cmplt

Command

class pygarmin.protocol.A907(gps, datatypes)

Bases: TransferProtocol

Undocumented application protocol.

class pygarmin.protocol.A1000(gps, datatypes)

Bases: TransferProtocol

Run Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Host to Device

pid_command_data

Command

1

Device to Host

pid_records

Records

2

Device to Host

pid_run

<D0>

k-2

Device to Host

pid_run

<D0>

k-1

Device to Host

pid_xfer_cmplt

Command

k

Host to Device

pid_command_data

Command

k+1

Device to Host

pid_records

Records

k+2

Device to Host

pid_lap

Lap

m-2

Device to Host

pid_lap

Lap

m-1

Device to Host

pid_xfer_cmplt

Command

m

Host to Device

pid_command_data

Command

m+1

Device to Host

pid_records

Records

m+2

Device to Host

pid_trk_hdr

TrkHdr

m+3

Device to Host

pid_trk_data

TrkPoint

n-2

Device to Host

pid_trk_data

TrkPoint

n-1

Device to Host

pid_xfer_cmplt

Command

class pygarmin.protocol.A1002(gps, datatypes)

Bases: TransferProtocol

Workout Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_command_data

Command

1

Device2 to Device1

pid_records

Records

2

Device2 to Device1

pid_workout

<D0>

m-2

Device2 to Device1

pid_workout

<D0>

m-1

Device2 to Device1

pid_xfer_cmplt

Command

m

Device1 to Device2

pid_command_data

Command

m+1

Device2 to Device1

pid_records

Records

m+2

Device2 to Device1

pid_workout_occurrence

Workout

n-2

Device2 to Device1

pid_workout_occurrence

Workout

n-1

Device2 to Device1

pid_xfer_cmplt

Command

class pygarmin.protocol.A1003(gps, datatypes)

Bases: TransferProtocol

Workout Occurrence Transfer Protocol.

class pygarmin.protocol.A1004(gps, datatypes)

Bases: TransferProtocol

Fitness User Profile Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_command_data

Command

1

Device2 to Device1

pid_fitness_user_profile

<D0>

class pygarmin.protocol.A1005(gps, datatypes)

Bases: TransferProtocol

Workout Limits Transfer Protocol.

N

Direction

Packet ID

Packet Data Type

0

Host to Device

pid_command_data

Command

1

Device to Host

pid_workout_limits

<D0>

class pygarmin.protocol.A1006(gps, datatypes)

Bases: TransferProtocol

Course Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Device1 to Device2

pid_command_data

Command

1

Device2 to Device1

pid_records

Records

2

Device2 to Device1

pid_course

<D0>

j-2

Device2 to Device1

pid_course

<D0>

j-1

Device2 to Device1

pid_xfer_cmplt

Command

j

Device1 to Device2

pid_command_data

Command

j+1

Device2 to Device1

pid_records

Records

j+2

Device2 to Device1

pid_course_lap

CourseLap

k-2

Device2 to Device1

pid_course_lap

CourseLap

k-1

Device2 to Device1

pid_xfer_cmplt

Command

k

Device1 to Device2

pid_command_data

Command

k+1

Device2 to Device1

pid_records

Records

k+2

Device2 to Device1

pid_course_trk_hdr

Course_TrkHdr

k+3

Device2 to Device1

pid_course_trk_data

Course_TrkPoint

m-2

Device2 to Device1

pid_course_trk_data

Course_TrkPoint

m-1

Device2 to Device1

pid_xfer_cmplt

Command

m

Device1 to Device2

pid_command_data

Command

m+1

Device2 to Device1

pid_records

Records

m+2

Device2 to Device1

pid_course_point

CoursePoint

n-2

Device2 to Device1

pid_course_point

CoursePoint

n-1

Device2 to Device1

pid_xfer_cmplt

Command

class pygarmin.protocol.A1007(gps, datatypes)

Bases: TransferProtocol

Course Lap Transfer Protocol.

class pygarmin.protocol.A1008(gps, datatypes)

Bases: TransferProtocol

Course Point Transfer Protocol.

class pygarmin.protocol.A1009(gps, datatypes)

Bases: TransferProtocol

Course Limits Transfer Protocol.

Packet sequence:

N

Direction

Packet ID

Packet Data Type

0

Host to Device

pid_command_data

Command

1

Device to Host

pid_course_limits

<D0>

class pygarmin.protocol.A1012(gps, datatypes)

Bases: TransferProtocol

Course Track Transfer Protocol.

class pygarmin.protocol.A1013(gps, datatypes)

Bases: TransferProtocol

Undocumented application protocol.

class pygarmin.protocol.ImageTransfer(gps)

Bases: object

Image transfer protocol.

With the image transfer protocol a screenshot and custom waypoint icons can be downloaded. The latter can also be uploaded. This protocol is undocumented. The implementation is derived from the GarminDev drivers of the abandoned QLandkarteGT application (https://sourceforge.net/projects/qlandkartegt/) and by reverse-engineering the Garmin xImage utility (https://www8.garmin.com/support/download_details.jsp?id=545). Compatible devices include the Garmin GPSMAP 60CX/60CSX, eTrex Legend C, eTrex Vista C, GPSMAP 60C/60CS, GPSMAP 76C/76CS. Some devices, like the 60C and 76C, originally didn’t support custom waypoint icons, but later it was added with a firmware update.

class pygarmin.protocol.ScreenshotTransfer(gps)

Bases: object