APIs for issuing commands to Mobiles. More...

Functions

zos_result_t s2c_command_issue (uint8_t mobile_num, const char *cmd,...)
 Issue a command to a locally connected Mobile. More...
 
zos_result_t s2c_command_issue_with_data (uint8_t mobile_num, const void *data, uint16_t data_len, const char *cmd,...)
 Issue a command with additional data to a locally connected Mobile. More...
 
zos_result_t s2c_command_issue_return_data (uint8_t mobile_num, void *buffer, uint16_t *buffer_len_ptr, const char *cmd,...)
 Issue command to Mobile, return binary data from response. More...
 
zos_result_t s2c_command_issue_return_uint32 (uint8_t mobile_num, uint32_t *retval_ptr, const char *cmd,...)
 Issue command to Mobile, return uint32 response value. More...
 
zos_result_t s2c_command_issue_return_str (uint8_t mobile_num, char *str_buffer, uint16_t max_len, const char *cmd,...)
 Issue command to Mobile, return null-terminated string response. More...
 

Detailed Description

APIs for issuing commands to Mobiles.

Function Documentation

zos_result_t s2c_command_issue ( uint8_t  mobile_num,
const char *  cmd,
  ... 
)

Issue a command to a locally connected Mobile.

Parameters
mobile_numThe mobile client number
cmdFormatted command string
Returns
Result of API call, see zos_result_t
zos_result_t s2c_command_issue_return_data ( uint8_t  mobile_num,
void *  buffer,
uint16_t *  buffer_len_ptr,
const char *  cmd,
  ... 
)

Issue command to Mobile, return binary data from response.

Like s2c_command_issue() this issues a command to a Mobile, however it also returns data from the command's response.

An example usage would be the read command

1 read 25
2 <25 bytes of data ...>

The 'cmd' arg would be the 'read 25', the 'buffer' arg would be a pointer to buffer to hold 25 bytes of response data from the Mobile.

Note
The buffer_len_ptr argument should point to a uint16_t variable containing the size of the supplied buffer. Upon returning the buffer_len_ptr argument contains the actual response data size received from the Mobile.
Parameters
mobile_numThe mobile client number
bufferBuffer to hold command response data
buffer_len_ptrPointer containing size of supplied buffer, upon returning contains actual response size from Mobile
cmdFormatted command string
Returns
Result of API call, see zos_result_t
zos_result_t s2c_command_issue_return_str ( uint8_t  mobile_num,
char *  str_buffer,
uint16_t  max_len,
const char *  cmd,
  ... 
)

Issue command to Mobile, return null-terminated string response.

Parameters
mobile_numThe mobile client number
str_bufferBuffer to hold string response
max_lenMaximum length of response string (i.e. size of string buffer)
cmdFormatted command string
Returns
Result of API call, see zos_result_t
zos_result_t s2c_command_issue_return_uint32 ( uint8_t  mobile_num,
uint32_t *  retval_ptr,
const char *  cmd,
  ... 
)

Issue command to Mobile, return uint32 response value.

Parameters
mobile_numThe mobile client number
retval_ptrPointer to uint32 to hold response value
cmdFormatted command string
Returns
Result of API call, see zos_result_t
zos_result_t s2c_command_issue_with_data ( uint8_t  mobile_num,
const void *  data,
uint16_t  data_len,
const char *  cmd,
  ... 
)

Issue a command with additional data to a locally connected Mobile.

Like s2c_command_issue() this issues a command to a Mobile, however it also supplies additional data after the command string.

An example usage would be the write command

1 write 25
2 <25 bytes of data ...>

The 'cmd' arg would be the 'write 25', the 'data' arg would be a pointer to buffer holding 25 bytes of data.

Parameters
mobile_numThe mobile client number
dataPointer to buffer holding command data
data_lenLength of data buffer
cmdFormatted command string
Returns
Result of API call, see zos_result_t