nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Command Decoder

Decoder for serialized commands from Application Chip. More...

Macros

#define RPC_DECODER_LENGTH_CHECK(LEN, INDEX, CMD)
 

Functions

uint32_t ble_rpc_cmd_resp_send (uint8_t op_code, uint32_t status)
 Function for sending a Command Response packet to the Application Chip through the transport layer. More...
 
uint32_t ble_rpc_cmd_resp_data_send (uint8_t op_code, uint8_t status, const uint8_t *const p_data, uint16_t data_len)
 Function for sending a command response with additional data to the Application Chip through the transport layer. More...
 
void ble_rpc_cmd_handle (void *p_event_data, uint16_t event_size)
 Function for scheduling an RPC command event to be processed in main-thread. More...
 

Detailed Description

This file contains declaration of common functions used for sending responses back to Application Chip after the command is processed, and function for processing commands received by the transport layer.

Macro Definition Documentation

#define RPC_DECODER_LENGTH_CHECK (   LEN,
  INDEX,
  CMD 
)
Value:
if ( INDEX > LEN) \

Function Documentation

uint32_t ble_rpc_cmd_resp_send ( uint8_t  op_code,
uint32_t  status 
)
Parameters
[in]op_codeThe op code of the command for which the Command Response is sent.
[in]statusThe status field to be encoded into the Command Response.
Return values
NRF_SUCCESSOn successful write of Command Response, otherwise an error code. If the transport layer returns an error code while sending the Command Response, the same error code will be returned by this function (see hci_transport_pkt_write for the list of error codes).
uint32_t ble_rpc_cmd_resp_data_send ( uint8_t  op_code,
uint8_t  status,
const uint8_t *const  p_data,
uint16_t  data_len 
)
Parameters
[in]op_codeThe op code of the command for which the Command Response is sent.
[in]statusThe status field to be encoded into the Command Response.
[in]p_dataThe data to be sent along with the status.
[in]data_lenThe length of the additional data.
Return values
NRF_SUCCESSOn successful write of Command Response, otherwise an error code. If the transport layer returns an error code while sending the Command Response, the same error code will be returned by this function (see hci_transport_pkt_write for the list of error codes).
void ble_rpc_cmd_handle ( void *  p_event_data,
uint16_t  event_size 
)

The function will read the arrived packet from the transport layer which is passed for decoding by the rpc_cmd_decoder module.

Parameters
[in]p_event_dataEvent data. This will be NULL as rpc_evt_schedule does not set any data.
[in]event_sizeEvent data size. This will be 0 as rpc_evt_schedule does not set any data.