TI BLE-Stack for Bluetooth 4.2 API Documentation  3.01.00.07
SNP API: DEVICE

Device API summary

Commands Acronyms / Event Name Origin Type TL Cmd0 TL Cmd1 Parameter structure
SNP_POWER_UP_IND NP Async SNP_NPI_ASYNC_CMD_TYPE (0x55) SNP_POWER_UP_IND (0x01)
SNP_MASK_EVT_REQ AP Sync Req SNP_NPI_SYNC_REQ_TYPE (0x35) SNP_MASK_EVT_REQ (0x02) snpMaskEventReq_t
SNP_MASK_EVENT_RSP NP Sync Rsp SNP_NPI_SYNC_RSP_TYPE (0x75) SNP_MASK_EVENT_RSP (0x02) snpMaskEventRsp_t
SNP_GET_REVISION_REQ AP Sync Req SNP_NPI_SYNC_REQ_TYPE (0x35) SNP_GET_REVISION_REQ (0x03)
SNP_GET_REVISION_RSP NP Sync Rsp SNP_NPI_SYNC_RSP_TYPE (0x75) SNP_GET_REVISION_RSP (0x03) snpGetRevisionRsp_t
SNP_HCI_CMD_REQ AP Async SNP_NPI_ASYNC_CMD_TYPE (0x55) SNP_HCI_CMD_REQ (0x04) snpHciCmdReq_t
SNP_HCI_CMD_RSP NP Async SNP_NPI_ASYNC_CMD_TYPE (0x55) SNP_HCI_CMD_RSP (0x04) snpHciCmdRsp_t
SNP_EVENT_IND NP Async SNP_NPI_ASYNC_CMD_TYPE (0x55) SNP_EVENT_IND (0x05) snpEvt_t
SNP_GET_STATUS_REQ AP Sync Req SNP_NPI_SYNC_REQ_TYPE (0x35) SNP_GET_STATUS_REQ (0x06)
SNP_GET_STATUS_RSP NP Sync Rsp SNP_NPI_SYNC_RSP_TYPE (0x75) SNP_GET_STATUS_RSP (0x06) snpGetStatusCmdRsp_t
SNP_GET_RAND_REQ AP Sync Req SNP_NPI_SYNC_REQ_TYPE (0x35) SNP_GET_RAND_REQ (0x07)
SNP_GET_RAND_RSP NP Sync Rsp SNP_NPI_SYNC_RSP_TYPE (0x75) SNP_GET_RAND_RSP (0x07) snpGetRandRsp_t
SNP_TEST_REQ AP Sync Req SNP_NPI_SYNC_REQ_TYPE (0x35) SNP_TEST_REQ (0x10)
SNP_TEST_RSP NP Sync Rsp SNP_NPI_SYNC_RSP_TYPE (0x75) SNP_TEST_RSP (0x10) snpTestCmdRsp_t
SNP_SYNC_ERROR_CMD_IND NP Async SNP_NPI_ASYNC_CMD_TYPE (0x55) SNP_SYNC_ERROR_CMD_IND (0x07)

All these command have some parameters. The parameters can be found/set using the indicated Parameter structure. All Parameter/Structures should be little-endian format (LSB first). For UUID parameters, dealing with UUID

SNP Power Up Indication

NP -> AP (N/A)

CMD 0 CMD 1
0x55 0x01
SNP_NPI_ASYNC_CMD_TYPE SNP_GET_REVISION_RSP

This event is send by the SNP once the device has powered up. This event will be received if the device is reset unexpectedly. One reception of this event the AP should consider that the NP lost any previous configuration.

When this event is received, the following services are initialized and ready to be used:

This command doesn't have any parameters

SNP Event Indication

NP -> AP (N/A)

CMD 0 CMD 1
0x55 0x05
SNP_NPI_ASYNC_CMD_TYPE SNP_EVENT_IND

This indication is send by the SNP to signal an event. Events can be masked by using the SNP_maskEvt API (SNP_maskEvt). Only one event will be indicated at a time per packet. If several events occur, each will be encapsulated in their own TL packet.

Payload Structure

Each event has a 2-bytes Event type, list of asynchronous events generated by the SNP. Along with Event type, some events might have some parameters associated with them.

Events parameters are mapped on the snpEvt_t structure, which contains a union of snpConnEstEvt_t, snpConnTermEvt_t , snpUpdateConnParamEvt_t , snpAdvStatusEvt_t and snpATTMTUSizeEvt_t

The table below list the events and the structure used to MAP the parameter of those events:

Event Parameter Structure Related
SNP_CONN_EST_EVT snpEvt_t + snpConnEstEvt_t N / A
SNP_CONN_TERM_EVT snpEvt_t + snpConnTermEvt_t SNP_terminateConn
SNP_CONN_PARAM_UPDATED_EVT snpEvt_t + snpUpdateConnParamEvt_t SNP_updateConnParam
SNP_ADV_STARTED_EVT snpEvt_t + snpAdvStatusEvt_t SNP_startAdv
SNP_ADV_ENDED_EVT snpEvt_t + snpAdvStatusEvt_t SNP_stopAdv
SNP_ATT_MTU_EVT snpEvt_t + snpATTMTUSizeEvt_t SNP Characteristic Read Indication (0x87)
SNP_ERROR_EVT snpEvt_t + snpErrorEvt_t SNP Synchronous Invalid Command Indication (0x07)

NP -> AP
snpEvt_t

Size Description
2 Byte SNP_CONN_PARAM_UPDATED_EVT
X Byte Parameter Structure based on table above

ATT MTU Size

The default ATT_MTU size is set to 23 bytes. The GATT client can request an ATT_MTU_EXCHANGE method to change the maximum possible ATT MTU size. The SNP is compatible with ATT MTU sizes up to 251 Bytes. If an update occurs due to a request from a peer device, the corresponding event will be send by the SNP to inform AP that MTU size has changed. If this event is not received, the AP must assume that ATT MTU size is 23.

Payload Structure

NP -> AP
snpEvt_t

Size Description
2 Byte SNP_ATT_MTU_EVT
1 Byte Connection Handle
2 Byte MTU Size of Connection

Error Event Indication

This error event occurs if something unexpected occurs while SNP is running some operation. The list of all possible SNP errors can be found here list of status generated by the SNP.

SNP Synchronous Invalid Command Indication (0x07)

NP -> AP (N/A)

CMD 0 CMD 1
0x55 0x07
SNP_NPI_ASYNC_CMD_TYPE SNP_SYNC_ERROR_CMD_IND

NP -> AP (N/A)

CMD 0 CMD 1
0x55 0x05
SNP_NPI_ASYNC_CMD_TYPE SNP_EVENT_IND

This indication packet will be send over TL if a unknown synchronous packet is send to the TL.

This indication is sent back to prevent TL lock up while waiting for a response.

Payload Structure

NP -> AP
No Parameter Structure

In addition to the indication, SNP_EVENT_IND with SNP_ERROR_EVT will be sent to AP with faulting opcode in parameter structure.

NP -> AP
snpEvt_t

Size Description
2 Byte SNP_ERROR_EVT
2 Byte SNP Opcode which produced error
1 Byte Error Status list of status generated by the SNP.
Copyright 2017, Texas Instruments Incorporated