Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_atci

AT command interface. More...

Data Structures

struct  bc_atci_param_t
 
struct  bc_atci_command_t
 AT command struct. More...
 

Macros

#define BC_ATCI_UART   BC_UART_UART2
 
#define BC_ATCI_COMMANDS_LENGTH(COMMANDS)   (sizeof(COMMANDS) / sizeof(COMMANDS[0]))
 
#define BC_ATCI_COMMAND_CLAC   {"+CLAC", bc_atci_clac_action, NULL, NULL, NULL, ""}
 
#define BC_ATCI_COMMAND_HELP   {"$HELP", bc_atci_help_action, NULL, NULL, NULL, "This help"}
 

Functions

void bc_atci_init (const bc_atci_command_t *commands, int length)
 Initialize. More...
 
void bc_atci_write_ok (void)
 Write OK.
 
void bc_atci_write_error (void)
 Write ERROR.
 
void bc_atci_printf (const char *format,...)
 Prinf message and add CR LF. More...
 
bool bc_atci_skip_response (void)
 Skip response, use in callback in bc_atci_command_t.
 
bool bc_atci_clac_action (void)
 Helper for clac action.
 
bool bc_atci_help_action (void)
 Helper for help action.
 
bool bc_atci_get_uint (bc_atci_param_t *param, uint32_t *value)
 Parse string to uint and move parsing cursor forward. More...
 
bool bc_atci_get_string (bc_atci_param_t *param, char *str, size_t length)
 Copy string and move parsing cursor forward. More...
 
bool bc_atci_get_buffer_from_hex_string (bc_atci_param_t *param, void *buffer, size_t *length)
 Decode HEX string to buffer and move parsing cursor forward. More...
 
bool bc_atci_is_comma (bc_atci_param_t *param)
 Check if the character at cursor is comma. More...
 
bool bc_atci_is_quotation_mark (bc_atci_param_t *param)
 Check if the character at cursor is quotation mark (") More...
 
void bc_atci_set_uart_active_callback (bool(*callback)(void), bc_tick_t scan_interval)
 Set callback function for scan if uart is active. Used for low-power when USB is disconnected (default callback: bc_system_get_vbus_sense, scan_interval: 200) More...
 

Detailed Description

AT command interface.

Function Documentation

bool bc_atci_get_buffer_from_hex_string ( bc_atci_param_t param,
void *  buffer,
size_t *  length 
)

Decode HEX string to buffer and move parsing cursor forward.

Parameters
[in]paramATCI instance
[out]destinationPointer to destination buffer
[in,out]lengthNumber of bytes to be read, Number of bytes read
Returns
true On success
false On failure

Definition at line 332 of file bc_atci.c.

bool bc_atci_get_string ( bc_atci_param_t param,
char *  str,
size_t  length 
)

Copy string and move parsing cursor forward.

Parameters
[in]paramATCI instance
[in]valuepointer to str destination
[in]lengthmaximum str length
Returns
true On success
false On failure

Definition at line 295 of file bc_atci.c.

bool bc_atci_get_uint ( bc_atci_param_t param,
uint32_t *  value 
)

Parse string to uint and move parsing cursor forward.

Parameters
[in]paramATCI instance
[in]valuepointer to number
Returns
true On success
false On failure

Definition at line 265 of file bc_atci.c.

void bc_atci_init ( const bc_atci_command_t commands,
int  length 
)

Initialize.

Parameters
[in]commands
[in]lengthNumber of commands

Definition at line 27 of file bc_atci.c.

Here is the call graph for this function:

bool bc_atci_is_comma ( bc_atci_param_t param)

Check if the character at cursor is comma.

Parameters
[in]paramATCI instance
Returns
true On success
false On failure

Definition at line 396 of file bc_atci.c.

bool bc_atci_is_quotation_mark ( bc_atci_param_t param)

Check if the character at cursor is quotation mark (")

Parameters
[in]paramATCI instance
Returns
true On success
false On failure

Definition at line 401 of file bc_atci.c.

void bc_atci_printf ( const char *  format,
  ... 
)

Prinf message and add CR LF.

Parameters
[in]formatFormat string (printf style)
[in]...Optional format arguments

Definition at line 46 of file bc_atci.c.

Referenced by bc_atci_clac_action(), and bc_atci_help_action().

Here is the call graph for this function:

Here is the caller graph for this function:

void bc_atci_set_uart_active_callback ( bool(*)(void)  callback,
bc_tick_t  scan_interval 
)

Set callback function for scan if uart is active. Used for low-power when USB is disconnected (default callback: bc_system_get_vbus_sense, scan_interval: 200)

Parameters
[in]callbackCallback function address
[in]scan_intervalDesired scan interval in ticks

Definition at line 406 of file bc_atci.c.

Referenced by bc_atci_init().

Here is the call graph for this function:

Here is the caller graph for this function: