TI BLE-Stack for Bluetooth 4.2 API Documentation  3.01.00.07
Files | Functions
SNP Device API

Files

file  simple_np_dev.h
 SNP Device API.
 

Functions

uint8_t SNP_executeHCIcmd (snpHciCmdReq_t *pReq, uint16_t dataLen)
 SNP Execute HCI Command (0x04) More...
 
void SNP_executeTestCmd (snpTestCmdRsp_t *pRsp)
 SNP Execute Memory Test. More...
 
void SNP_getRand (snpGetRandRsp_t *pRsp)
 SNP Get Random Number. More...
 
void SNP_getRev (snpGetRevisionRsp_t *Msg)
 SNP Get Revision. More...
 
void SNP_getStatus (snpGetStatusCmdRsp_t *pRsp)
 SNP Get Status. More...
 
void SNP_maskEvt (snpMaskEventReq_t *pReq, snpMaskEventRsp_t *pRsp)
 SNP Mask Event (0x02) More...
 

Detailed Description

Function Documentation

§ SNP_executeHCIcmd()

uint8_t SNP_executeHCIcmd ( snpHciCmdReq_t pReq,
uint16_t  dataLen 
)

SNP Execute HCI Command (0x04)

AP -> NP (SNP_executeTestCmd)

CMD 0 CMD 1
0x55 0x04
SNP_NPI_ASYNC_CMD_TYPE SNP_HCI_CMD_REQ

NP -> AP (N/A)

CMD 0 CMD 1
0x55 0x04
SNP_NPI_ASYNC_CMD_TYPE SNP_HCI_CMD_RSP

The SNP Encapsulated HCI Command is used to encapsulate and send an HCI command to the SNP. Only the HCI commands listed in the parameter section below are supported.

The functionality of the HCI extension commands can be found in the HCI Vendor Specific Guide. The format of these commands can also be found in the Vendor Specific guide. Note that some HCI commands are defined in the Bluetooth Specification

The list of supported HCI commands are list of all HCI commands allowed by the SNP.

Corresponding Events/Commands
SNP_HCI_CMD_REQ (from AP) | SNP_HCI_CMD_RSP (from SNP)
Payload Structures

AP -> NP
snpHciCmdReq_t

Size Description
2 Byte HCI Command Opcode to Execute list of all HCI commands allowed by the SNP.
X Byte Parameters, if required by HCI Command

NP -> AP
snpHciCmdRsp_t

Size Description
1 Byte Command Status list of status generated by the SNP.
2 Byte HCI Command Opcode Executed list of all HCI commands allowed by the SNP.
X Byte Return Values if HCI Command has any
Parameters
[in]pReq:HCI Request Structure, snpHciCmdReq_t
[in]dataLen:Length in Bytes of snpHciCmdReq_t::pData
Returns
1 Byte Error Code, list of status generated by the SNP.

§ SNP_executeTestCmd()

void SNP_executeTestCmd ( snpTestCmdRsp_t pRsp)

SNP Execute Memory Test.

AP -> NP (SNP_executeTestCmd)

CMD 0 CMD 1
0x35 0x10
SNP_NPI_SYNC_REQ_TYPE SNP_GET_STATUS_REQ

NP -> AP (N/A)

CMD 0 CMD 1
0x75 0x10
SNP_NPI_SYNC_RSP_TYPE SNP_GET_STATUS_RSP

This SNP Test command is used to profile the heap usage of the SNP.

Corresponding Events/Commands
SNP_TEST_REQ (from AP) | SNP_TEST_RSP (from SNP)
Payload Structures

AP -> NP
No Parameter Structure

NP -> AP
snpTestCmdRsp_t

Size Description
2 Byte HEAP allocated in bytes
2 Byte Peak HEAP Allocated since startup
2 Byte Total HEAP Size
Parameters
[out]pRsp: Heap Test Command Response Structure, snpTestCmdRsp_t

§ SNP_getRand()

void SNP_getRand ( snpGetRandRsp_t pRsp)

SNP Get Random Number.

AP -> NP (SNP_getRand)

CMD 0 CMD 1
0x35 0x08
SNP_NPI_SYNC_REQ_TYPE SNP_GET_RAND_REQ

NP -> AP (SNP_getRand)

CMD 0 CMD 1
0x75 0x08
SNP_NPI_SYNC_RSP_TYPE SNP_GET_RAND_RSP

This SNP Test command is used to access the true random number generator on the SNP and return a random number to the AP.

Corresponding Events/Commands
SNP_GET_RAND_REQ (from AP) | SNP_GET_RAND_RSP (from SNP)
Payload Structures

AP -> NP
No Parameter Payload

NP -> AP
snpGetRandRsp_t

Size Description
4 Byte 32-bit Random Number from TRNG
Parameters
[out]pRsp: Get Random Number Response Structure snpGetRandRsp_t

§ SNP_getRev()

void SNP_getRev ( snpGetRevisionRsp_t Msg)

SNP Get Revision.

AP -> NP (SNP_getRev)

CMD 0 CMD 1
0x35 0x03
SNP_NPI_SYNC_REQ_TYPE SNP_GET_REVISION_REQ

NP -> AP (SNP_getRev)

CMD 0 CMD 1
0x75 0x03
SNP_NPI_SYNC_RSP_TYPE SNP_GET_REVISION_RSP

The SNP Get Revision command is used to get the current revision of the SNP API as well as the full stack revision number as defined in the HCI vendor guide.

Corresponding Events/Commands
SNP_GET_REVISION_REQ (from AP) | @ ref SNP_GET_REVISION_RSP (from SNP)
Payload Structures

AP -> NP
No Parameter Payload

NP -> AP
snpGetRevisionRsp_t

Size Description
1 Byte Command Status list of status generated by the SNP.
2 Byte Version of SNP [Major, Minor]
10 Byte See TI Vendor Specific HCI Guide
Parameters
[out]Msg: Get Revision Response Structure, snpGetRevisionRsp_t

§ SNP_getStatus()

void SNP_getStatus ( snpGetStatusCmdRsp_t pRsp)

SNP Get Status.

AP -> NP (SNP_getStatus)

CMD 0 CMD 1
0x35 0x06
SNP_NPI_SYNC_REQ_TYPE SNP_GET_STATUS_REQ

NP -> AP (SNP_getStatus)

CMD 0 CMD 1
0x75 0x06
SNP_NPI_SYNC_RSP_TYPE SNP_GET_STATUS_RSP

The SNP Get Status command is used to get the current status of the SNP

Corresponding Events/Commands
SNP_GET_STATUS_REQ (from AP) | SNP_GET_STATUS_RSP (from SNP)
Payload Structures

AP -> NP
No Parameter Structure

NP -> AP
snpGetStatusCmdRsp_t

Size Description
1 Byte Current State of the GAP Role gaprole_States_t

1 Byte | Current State of Advertising (TRUE | FALSE) 1 Byte | Current State of the GATT server (TRUE | FALSE) 1 Byte | Current GATT Methods (only if previous byte is TRUE)

Parameters
[out]pRsp: Get Status Response Structure, snpGetStatusCmdRsp_t

§ SNP_maskEvt()

void SNP_maskEvt ( snpMaskEventReq_t pReq,
snpMaskEventRsp_t pRsp 
)

SNP Mask Event (0x02)

AP -> NP (SNP_maskEvt)

CMD 0 CMD 1
0x35 0x02
SNP_NPI_SYNC_REQ_TYPE SNP_MASK_EVENT_RSP

NP -> AP (SNP_maskEvt)

CMD 0 CMD 1
0x75 0x02
SNP_NPI_SYNC_RSP_TYPE SNP_MASK_EVENT_RSP

The SNP Mask Event command enables the AP to mask some events returned from the SNP if they are not needed by the AP.

Masking events may be useful in order to limit the possible wake up conditions of the AP, thus reducing power consumption.

All of the events that can be masked by this command are triggered asynchronously due to an action from the AP, an action of the remote peer, or timer expiration.

By default, ALL events are enabled and will be returned to the AP.

For a list of events, see list of asynchronous events generated by the SNP..

Corresponding Events/Commands
SNP_MASK_EVENT_RSP (from AP) | SNP_MASK_EVENT_RSP (from SNP)
Payload Structures

AP -> NP
snpMaskEventReq_t

Size Description
2 Byte Events Requested to be Masked list of asynchronous events generated by the SNP.

NP -> AP
snpMaskEventRsp_t

Size Description
2 Byte Events that have been Masked list of asynchronous events generated by the SNP.
Parameters
[in]pReq: Mask Event Request Structure, snpMaskEventReq_t
[out]pRsp: Mask Event Request Response, snpMaskEventRsp_t
Copyright 2017, Texas Instruments Incorporated