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

Radio implementation. More...

Data Structures

struct  bc_radio_sub_t
 
struct  bc_radio_peer_t
 

Macros

#define BC_RADIO_MAX_DEVICES   4
 
#define BC_RADIO_PUB_QUEUE_BUFFER_SIZE   512
 
#define BC_RADIO_RX_QUEUE_BUFFER_SIZE   128
 
#define BC_RADIO_ID_SIZE   6
 
#define BC_RADIO_HEAD_SIZE   (BC_RADIO_ID_SIZE + 2)
 
#define BC_RADIO_MAX_BUFFER_SIZE   (BC_SPIRIT1_MAX_PACKET_SIZE - BC_RADIO_HEAD_SIZE)
 
#define BC_RADIO_MAX_TOPIC_LEN   (BC_RADIO_MAX_BUFFER_SIZE - 1 - 4 - 1)
 
#define BC_RADIO_NULL_BOOL   0xff
 
#define BC_RADIO_NULL_INT   INT32_MIN
 
#define BC_RADIO_NULL_FLOAT   NAN
 
#define BC_RADIO_NULL_UINT32   UINT32_MAX
 
#define BC_RADIO_NULL_UINT16   UINT16_MAX
 
#define BC_RADIO_NODE_HEAD_SIZE   (BC_RADIO_HEAD_SIZE + 1 + BC_RADIO_ID_SIZE)
 
#define BC_RADIO_NODE_MAX_BUFFER_SIZE   (BC_RADIO_MAX_BUFFER_SIZE - BC_RADIO_ID_SIZE - 1)
 
#define BC_RADIO_NODE_MAX_COMPOUND_PART   (BC_RADIO_NODE_MAX_BUFFER_SIZE / 5)
 
#define BC_RADIO_NODE_MAX_COMPOUND_BUFFER_SIZE   (BC_RADIO_NODE_MAX_COMPOUND_PART * 5)
 

Typedefs

typedef struct bc_radio_sub_t bc_radio_sub_t
 

Enumerations

enum  bc_radio_mode_t {
  BC_RADIO_MODE_UNKNOWN = 0,
  BC_RADIO_MODE_GATEWAY = 1,
  BC_RADIO_MODE_NODE_LISTENING = 2,
  BC_RADIO_MODE_NODE_SLEEPING = 3
}
 Radio mode. More...
 
enum  bc_radio_event_t {
  BC_RADIO_EVENT_INIT_FAILURE = 0,
  BC_RADIO_EVENT_INIT_DONE = 1,
  BC_RADIO_EVENT_ATTACH = 2,
  BC_RADIO_EVENT_ATTACH_FAILURE = 3,
  BC_RADIO_EVENT_DETACH = 4,
  BC_RADIO_EVENT_SCAN_FIND_DEVICE = 5,
  BC_RADIO_EVENT_PAIRED = 6,
  BC_RADIO_EVENT_UNPAIRED = 7,
  BC_RADIO_EVENT_TX_DONE = 8,
  BC_RADIO_EVENT_TX_ERROR = 9
}
 
enum  bc_radio_header_t {
  BC_RADIO_HEADER_PAIRING = 0x00,
  BC_RADIO_HEADER_PUB_PUSH_BUTTON = 0x01,
  BC_RADIO_HEADER_PUB_TEMPERATURE = 0x02,
  BC_RADIO_HEADER_PUB_HUMIDITY = 0x03,
  BC_RADIO_HEADER_PUB_LUX_METER = 0x04,
  BC_RADIO_HEADER_PUB_BAROMETER = 0x05,
  BC_RADIO_HEADER_PUB_CO2 = 0x06,
  BC_RADIO_HEADER_PUB_BUFFER = 0x07,
  BC_RADIO_HEADER_NODE_ATTACH = 0x08,
  BC_RADIO_HEADER_NODE_DETACH = 0x09,
  BC_RADIO_HEADER_PUB_BATTERY = 0x0a,
  BC_RADIO_HEADER_PUB_INFO = 0x0b,
  BC_RADIO_HEADER_PUB_ACCELERATION = 0x0d,
  BC_RADIO_HEADER_PUB_TOPIC_STRING = 0x0e,
  BC_RADIO_HEADER_PUB_TOPIC_UINT32 = 0x0f,
  BC_RADIO_HEADER_PUB_TOPIC_BOOL = 0x10,
  BC_RADIO_HEADER_PUB_TOPIC_INT = 0x11,
  BC_RADIO_HEADER_PUB_TOPIC_FLOAT = 0x12,
  BC_RADIO_HEADER_PUB_EVENT_COUNT = 0x13,
  BC_RADIO_HEADER_PUB_STATE = 0x14,
  BC_RADIO_HEADER_NODE_STATE_SET = 0x15,
  BC_RADIO_HEADER_NODE_STATE_GET = 0x16,
  BC_RADIO_HEADER_NODE_BUFFER = 0x17,
  BC_RADIO_HEADER_NODE_LED_STRIP_COLOR_SET = 0x18,
  BC_RADIO_HEADER_NODE_LED_STRIP_BRIGHTNESS_SET = 0x19,
  BC_RADIO_HEADER_NODE_LED_STRIP_COMPOUND_SET = 0x1a,
  BC_RADIO_HEADER_NODE_LED_STRIP_EFFECT_SET = 0x1b,
  BC_RADIO_HEADER_NODE_LED_STRIP_THERMOMETER_SET = 0x1c,
  BC_RADIO_HEADER_SUB_DATA = 0x1d,
  BC_RADIO_HEADER_PUB_VALUE_INT = 0x1e,
  BC_RADIO_HEADER_SUB_REG = 0x20,
  BC_RADIO_HEADER_ACK = 0xaa
}
 
enum  bc_radio_sub_pt_t {
  BC_RADIO_SUB_PT_BOOL = 0,
  BC_RADIO_SUB_PT_INT = 1,
  BC_RADIO_SUB_PT_FLOAT = 2,
  BC_RADIO_SUB_PT_STRING = 3,
  BC_RADIO_SUB_PT_NULL = 4
}
 Subscribe payload type.
 
enum  {
  BC_RADIO_NODE_STATE_LED = BC_RADIO_PUB_STATE_LED,
  BC_RADIO_NODE_STATE_RELAY_MODULE_0 = BC_RADIO_PUB_STATE_RELAY_MODULE_0,
  BC_RADIO_NODE_STATE_RELAY_MODULE_1 = BC_RADIO_PUB_STATE_RELAY_MODULE_1,
  BC_RADIO_NODE_STATE_POWER_MODULE_RELAY = BC_RADIO_PUB_STATE_POWER_MODULE_RELAY
}
 
enum  bc_radio_node_led_strip_effect_t {
  BC_RADIO_NODE_LED_STRIP_EFFECT_TEST = 0,
  BC_RADIO_NODE_LED_STRIP_EFFECT_RAINBOW = 1,
  BC_RADIO_NODE_LED_STRIP_EFFECT_RAINBOW_CYCLE = 2,
  BC_RADIO_NODE_LED_STRIP_EFFECT_THEATER_CHASE_RAINBOW = 3,
  BC_RADIO_NODE_LED_STRIP_EFFECT_COLOR_WIPE = 4,
  BC_RADIO_NODE_LED_STRIP_EFFECT_THEATER_CHASE = 5,
  BC_RADIO_NODE_LED_STRIP_EFFECT_STROBOSCOPE = 6,
  BC_RADIO_NODE_LED_STRIP_EFFECT_ICICLE = 7,
  BC_RADIO_NODE_LED_STRIP_EFFECT_PULSE_COLOR = 8
}
 
enum  {
  BC_RADIO_PUB_CHANNEL_R1_I2C0_ADDRESS_DEFAULT = 0x00,
  BC_RADIO_PUB_CHANNEL_R1_I2C0_ADDRESS_ALTERNATE = 0x01,
  BC_RADIO_PUB_CHANNEL_R1_I2C1_ADDRESS_DEFAULT = 0x80,
  BC_RADIO_PUB_CHANNEL_R1_I2C1_ADDRESS_ALTERNATE = 0x81,
  BC_RADIO_PUB_CHANNEL_R2_I2C0_ADDRESS_DEFAULT = 0x02,
  BC_RADIO_PUB_CHANNEL_R2_I2C0_ADDRESS_ALTERNATE = 0x03,
  BC_RADIO_PUB_CHANNEL_R2_I2C1_ADDRESS_DEFAULT = 0x82,
  BC_RADIO_PUB_CHANNEL_R2_I2C1_ADDRESS_ALTERNATE = 0x83,
  BC_RADIO_PUB_CHANNEL_R3_I2C0_ADDRESS_DEFAULT = 0x04,
  BC_RADIO_PUB_CHANNEL_R3_I2C0_ADDRESS_ALTERNATE = 0x05,
  BC_RADIO_PUB_CHANNEL_R3_I2C1_ADDRESS_DEFAULT = 0x84,
  BC_RADIO_PUB_CHANNEL_R3_I2C1_ADDRESS_ALTERNATE = 0x85,
  BC_RADIO_PUB_CHANNEL_A = 0xf0,
  BC_RADIO_PUB_CHANNEL_B = 0xf1,
  BC_RADIO_PUB_CHANNEL_SET_POINT = 0xf2
}
 
enum  {
  BC_RADIO_PUB_EVENT_PUSH_BUTTON = 0,
  BC_RADIO_PUB_EVENT_PIR_MOTION = 1,
  BC_RADIO_PUB_EVENT_LCD_BUTTON_LEFT = 2,
  BC_RADIO_PUB_EVENT_LCD_BUTTON_RIGHT = 3,
  BC_RADIO_PUB_EVENT_ACCELEROMETER_ALERT = 4,
  BC_RADIO_PUB_EVENT_HOLD_BUTTON = 5
}
 
enum  {
  BC_RADIO_PUB_STATE_LED = 0,
  BC_RADIO_PUB_STATE_RELAY_MODULE_0 = 1,
  BC_RADIO_PUB_STATE_RELAY_MODULE_1 = 2,
  BC_RADIO_PUB_STATE_POWER_MODULE_RELAY = 3
}
 
enum  { BC_RADIO_PUB_VALUE_HOLD_DURATION_BUTTON = 0 }
 

Functions

void bc_radio_init (bc_radio_mode_t mode)
 Initialize radio. More...
 
void bc_radio_set_event_handler (void(*event_handler)(bc_radio_event_t, void *), void *event_param)
 
void bc_radio_listen (bc_tick_t timeout)
 
void bc_radio_pairing_request (const char *firmware, const char *version)
 
void bc_radio_pairing_mode_start (void)
 
void bc_radio_pairing_mode_stop (void)
 
bool bc_radio_peer_device_add (uint64_t id)
 
bool bc_radio_peer_device_remove (uint64_t id)
 
bool bc_radio_peer_device_purge_all (void)
 
void bc_radio_get_peer_id (uint64_t *id, int length)
 
void bc_radio_scan_start (void)
 
void bc_radio_scan_stop (void)
 
void bc_radio_automatic_pairing_start (void)
 
void bc_radio_automatic_pairing_stop (void)
 
uint64_t bc_radio_get_my_id (void)
 
uint64_t bc_radio_get_event_id (void)
 
bool bc_radio_is_peer_device (uint64_t id)
 
bool bc_radio_pub_queue_put (const void *buffer, size_t length)
 
void bc_radio_set_subs (bc_radio_sub_t *subs, int length)
 
bool bc_radio_send_sub_data (uint64_t *id, uint8_t order, void *payload, size_t size)
 
void bc_radio_set_rx_timeout_for_sleeping_node (bc_tick_t timeout)
 
bc_radio_peer_tbc_radio_get_peer_device (uint64_t id)
 
uint8_t * bc_radio_id_to_buffer (uint64_t *id, uint8_t *buffer)
 
uint8_t * bc_radio_bool_to_buffer (bool *value, uint8_t *buffer)
 
uint8_t * bc_radio_int_to_buffer (int *value, uint8_t *buffer)
 
uint8_t * bc_radio_uint16_to_buffer (uint16_t *value, uint8_t *buffer)
 
uint8_t * bc_radio_uint32_to_buffer (uint32_t *value, uint8_t *buffer)
 
uint8_t * bc_radio_float_to_buffer (float *value, uint8_t *buffer)
 
uint8_t * bc_radio_data_to_buffer (void *data, size_t length, uint8_t *buffer)
 
uint8_t * bc_radio_id_from_buffer (uint8_t *buffer, uint64_t *id)
 
uint8_t * bc_radio_bool_from_buffer (uint8_t *buffer, bool *value, bool **pointer)
 
uint8_t * bc_radio_int_from_buffer (uint8_t *buffer, int *value, int **pointer)
 
uint8_t * bc_radio_uint16_from_buffer (uint8_t *buffer, uint16_t *value, uint16_t **pointer)
 
uint8_t * bc_radio_uint32_from_buffer (uint8_t *buffer, uint32_t *value, uint32_t **pointer)
 
uint8_t * bc_radio_float_from_buffer (uint8_t *buffer, float *value, float **pointer)
 
uint8_t * bc_radio_data_from_buffer (uint8_t *buffer, void *data, size_t length)
 
void bc_radio_init_pairing_button ()
 
bool bc_radio_node_state_set (uint64_t *id, uint8_t state_id, bool *state)
 Send request for set new state. More...
 
bool bc_radio_node_state_get (uint64_t *id, uint8_t state_id)
 Send request for get actual state. More...
 
bool bc_radio_node_buffer (uint64_t *id, void *buffer, size_t length)
 Send data to node. More...
 
bool bc_radio_node_led_strip_color_set (uint64_t *id, uint32_t color)
 Send data to node. More...
 
bool bc_radio_node_led_strip_brightness_set (uint64_t *id, uint8_t brightness)
 Send data to node. More...
 
bool bc_radio_node_led_strip_compound_set (uint64_t *id, uint8_t *compound, size_t length)
 Send data to node. More...
 
bool bc_radio_node_led_strip_effect_set (uint64_t *id, bc_radio_node_led_strip_effect_t type, uint16_t wait, uint32_t color)
 Send data to node. More...
 
bool bc_radio_node_led_strip_thermometer_set (uint64_t *id, float temperature, int8_t min, int8_t max, uint8_t white_dots, float *set_point, uint32_t set_point_color)
 Send data to node. More...
 
void bc_radio_node_decode (uint64_t *id, uint8_t *buffer, size_t length)
 Internal decode function for bc_radio.c. More...
 
bool bc_radio_pub_event_count (uint8_t event_id, uint16_t *event_count)
 Publish event count. More...
 
bool bc_radio_pub_push_button (uint16_t *event_count)
 Publish push button event count, same as use bc_radio_pub_event_count with BC_RADIO_PUB_EVENT_PUSH_BUTTON. More...
 
bool bc_radio_pub_temperature (uint8_t channel, float *celsius)
 Publish temperature. More...
 
bool bc_radio_pub_humidity (uint8_t channel, float *percentage)
 Publish humidity. More...
 
bool bc_radio_pub_luminosity (uint8_t channel, float *lux)
 Publish luminosity. More...
 
bool bc_radio_pub_barometer (uint8_t channel, float *pascal, float *meter)
 Publish barometer. More...
 
bool bc_radio_pub_co2 (float *concentration)
 Publish co2. More...
 
bool bc_radio_pub_battery (float *voltage)
 Publish battery. More...
 
bool bc_radio_pub_acceleration (float *x_axis, float *y_axis, float *z_axis)
 Publish acceleration. More...
 
bool bc_radio_pub_buffer (void *buffer, size_t length)
 Publish buffer. More...
 
bool bc_radio_pub_state (uint8_t state_id, bool *state)
 Publish battery. More...
 
bool bc_radio_pub_value_int (uint8_t value_id, int *value)
 Publish int value. More...
 
bool bc_radio_pub_bool (const char *subtopic, bool *value)
 Publish bool value in custom topic. More...
 
bool bc_radio_pub_int (const char *subtopic, int *value)
 Publish int value in custom topic. More...
 
bool bc_radio_pub_uint32 (const char *subtopic, uint32_t *value)
 Publish uint32 value in custom topic. More...
 
bool bc_radio_pub_float (const char *subtopic, float *value)
 Publish float value in custom topic. More...
 
bool bc_radio_pub_string (const char *subtopic, const char *value)
 Publish string value in custom topic. More...
 
void bc_radio_pub_decode (uint64_t *id, uint8_t *buffer, size_t length)
 Internal decode function for bc_radio.c. More...
 

Detailed Description

Radio implementation.

Radio implementation send to gateway.

Radio implementation send to node.

Enumeration Type Documentation

anonymous enum
Enumerator
BC_RADIO_PUB_CHANNEL_R1_I2C0_ADDRESS_DEFAULT 

channel 0:0

BC_RADIO_PUB_CHANNEL_R1_I2C0_ADDRESS_ALTERNATE 

channel 0:1

BC_RADIO_PUB_CHANNEL_R1_I2C1_ADDRESS_DEFAULT 

channel 1:0

BC_RADIO_PUB_CHANNEL_R1_I2C1_ADDRESS_ALTERNATE 

channel 1:1

BC_RADIO_PUB_CHANNEL_R2_I2C0_ADDRESS_DEFAULT 

channel 0:2

BC_RADIO_PUB_CHANNEL_R2_I2C0_ADDRESS_ALTERNATE 

channel 0:3

BC_RADIO_PUB_CHANNEL_R2_I2C1_ADDRESS_DEFAULT 

channel 1:2

BC_RADIO_PUB_CHANNEL_R2_I2C1_ADDRESS_ALTERNATE 

channel 1:3

BC_RADIO_PUB_CHANNEL_R3_I2C0_ADDRESS_DEFAULT 

channel 0:4

BC_RADIO_PUB_CHANNEL_R3_I2C0_ADDRESS_ALTERNATE 

channel 0:5

BC_RADIO_PUB_CHANNEL_R3_I2C1_ADDRESS_DEFAULT 

channel 1:4

BC_RADIO_PUB_CHANNEL_R3_I2C1_ADDRESS_ALTERNATE 

channel 1:5

BC_RADIO_PUB_CHANNEL_A 

channel a

BC_RADIO_PUB_CHANNEL_B 

channel b

BC_RADIO_PUB_CHANNEL_SET_POINT 

channel set-point

Definition at line 10 of file bc_radio_pub.h.

Radio mode.

Enumerator
BC_RADIO_MODE_UNKNOWN 

Unknown mode.

BC_RADIO_MODE_GATEWAY 

Gateway mode.

BC_RADIO_MODE_NODE_LISTENING 

Node listening mode.

BC_RADIO_MODE_NODE_SLEEPING 

Node sleeping mode, suitable for battery.

Definition at line 37 of file bc_radio.h.

Function Documentation

void bc_radio_init ( bc_radio_mode_t  mode)

Initialize radio.

Parameters
[in]mode

Definition at line 89 of file bc_radio.c.

Here is the call graph for this function:

bool bc_radio_node_buffer ( uint64_t *  id,
void *  buffer,
size_t  length 
)

Send data to node.

Parameters
[in]idPointer to node id
[in]bufferPointer to buffer from which data will be send
[in]lengthNumber of bytes to be send, max value is in BC_RADIO_NODE_MAX_BUFFER_SIZE
Returns
true On success
false On failure

Definition at line 41 of file bc_radio_node.c.

void bc_radio_node_decode ( uint64_t *  id,
uint8_t *  buffer,
size_t  length 
)

Internal decode function for bc_radio.c.

Parameters
[in]idPointer on own id
[in]bufferPointer to RX buffer
[in]lengthRX buffer length

Definition at line 148 of file bc_radio_node.c.

bool bc_radio_node_led_strip_brightness_set ( uint64_t *  id,
uint8_t  brightness 
)

Send data to node.

Parameters
[in]idPointer to node id
[in]brightness
Returns
true On success
false On failure

Definition at line 71 of file bc_radio_node.c.

bool bc_radio_node_led_strip_color_set ( uint64_t *  id,
uint32_t  color 
)

Send data to node.

Parameters
[in]idPointer to node id
[in]colorColor in RGBW format
Returns
true On success
false On failure

Definition at line 58 of file bc_radio_node.c.

bool bc_radio_node_led_strip_compound_set ( uint64_t *  id,
uint8_t *  compound,
size_t  length 
)

Send data to node.

Parameters
[in]idPointer to node id
[in]compoundPointer to compound buffer
[in]lengthNumber of bytes to be send, must be modulo 5, max value is in BC_RADIO_NODE_MAX_COMPOUND_BUFFER_SIZE
Returns
true On success
false On failure

Definition at line 84 of file bc_radio_node.c.

bool bc_radio_node_led_strip_effect_set ( uint64_t *  id,
bc_radio_node_led_strip_effect_t  type,
uint16_t  wait,
uint32_t  color 
)

Send data to node.

Parameters
[in]idPointer to node id
[in]typeEffect type
[in]waitInterval between refresh
[in]colorColor in RGBW format
Returns
true On success
false On failure

Definition at line 102 of file bc_radio_node.c.

bool bc_radio_node_led_strip_thermometer_set ( uint64_t *  id,
float  temperature,
int8_t  min,
int8_t  max,
uint8_t  white_dots,
float *  set_point,
uint32_t  set_point_color 
)

Send data to node.

Parameters
[in]idPointer to node id
[in]temperature
[in]minTemperature on thermometer
[in]maxTemperature on thermometer
[in]white_dots
[in]set_pointPointer to set point temperature, if NULL set_point and set_point_color not used
[in]set_point_colorColor in RGBW format
Returns
true On success
false On failure

Definition at line 120 of file bc_radio_node.c.

bool bc_radio_node_state_get ( uint64_t *  id,
uint8_t  state_id 
)

Send request for get actual state.

Parameters
[in]idPointer to node id
[in]state_idState id from enum
Returns
true On success
false On failure

Definition at line 28 of file bc_radio_node.c.

bool bc_radio_node_state_set ( uint64_t *  id,
uint8_t  state_id,
bool *  state 
)

Send request for set new state.

Parameters
[in]idPointer to node id
[in]state_idState id from enum
[in]statePointer to state which will be send
Returns
true On success
false On failure

Definition at line 13 of file bc_radio_node.c.

bool bc_radio_pub_acceleration ( float *  x_axis,
float *  y_axis,
float *  z_axis 
)

Publish acceleration.

Parameters
[in]x_axisPointer to value, can be null
[in]y_axisPointer to value, can be null
[in]x_az_axisxisPointer to value, can be null
Returns
true On success
false On failure

Definition at line 112 of file bc_radio_pub.c.

bool bc_radio_pub_barometer ( uint8_t  channel,
float *  pascal,
float *  meter 
)

Publish barometer.

Parameters
[in]channelChannel id from enum BC_RADIO_PUB_CHANNEL_*
[in]pascalPointer to value, can be null
[in]meterPointer to value, can be null
Returns
true On success
false On failure

Definition at line 77 of file bc_radio_pub.c.

bool bc_radio_pub_battery ( float *  voltage)

Publish battery.

Parameters
[in]voltagePointer to value, can be null
Returns
true On success
false On failure

Definition at line 101 of file bc_radio_pub.c.

bool bc_radio_pub_bool ( const char *  subtopic,
bool *  value 
)

Publish bool value in custom topic.

Parameters
[in]subtopicSubtopic (example: node/{id}/{subtopic})
[in]valuePointer to value, can be null
Returns
true On success
false On failure

Definition at line 167 of file bc_radio_pub.c.

bool bc_radio_pub_buffer ( void *  buffer,
size_t  length 
)

Publish buffer.

Parameters
[in]bufferPointer to buffer from which data will be send
[in]lengthNumber of bytes to be send, max value is in BC_RADIO_NODE_MAX_BUFFER_SIZE
Returns
true On success
false On failure

Definition at line 127 of file bc_radio_pub.c.

bool bc_radio_pub_co2 ( float *  concentration)

Publish co2.

Parameters
[in]concentrationPointer to value, can be null
Returns
true On success
false On failure

Definition at line 90 of file bc_radio_pub.c.

void bc_radio_pub_decode ( uint64_t *  id,
uint8_t *  buffer,
size_t  length 
)

Internal decode function for bc_radio.c.

Parameters
[in]idPointer on sender id
[in]bufferPointer to RX buffer
[in]lengthRX buffer length

Definition at line 267 of file bc_radio_pub.c.

bool bc_radio_pub_event_count ( uint8_t  event_id,
uint16_t *  event_count 
)

Publish event count.

Parameters
[in]event_idEvent id is from enum BC_RADIO_PUB_EVENT_*
[in]event_countPointer to value, can be null
Returns
true On success
false On failure

Definition at line 24 of file bc_radio_pub.c.

Referenced by bc_radio_pub_push_button().

Here is the caller graph for this function:

bool bc_radio_pub_float ( const char *  subtopic,
float *  value 
)

Publish float value in custom topic.

Parameters
[in]subtopicSubtopic (example: node/{id}/{subtopic})
[in]valuePointer to value, can be null
Returns
true On success
false On failure

Definition at line 227 of file bc_radio_pub.c.

bool bc_radio_pub_humidity ( uint8_t  channel,
float *  percentage 
)

Publish humidity.

Parameters
[in]channelChannel id from enum BC_RADIO_PUB_CHANNEL_*
[in]percentagePointer to value, can be null
Returns
true On success
false On failure

Definition at line 53 of file bc_radio_pub.c.

bool bc_radio_pub_int ( const char *  subtopic,
int *  value 
)

Publish int value in custom topic.

Parameters
[in]subtopicSubtopic (example: node/{id}/{subtopic})
[in]valuePointer to value, can be null
Returns
true On success
false On failure

Definition at line 187 of file bc_radio_pub.c.

bool bc_radio_pub_luminosity ( uint8_t  channel,
float *  lux 
)

Publish luminosity.

Parameters
[in]channelChannel id from enum BC_RADIO_PUB_CHANNEL_*
[in]luxPointer to value, can be null
Returns
true On success
false On failure

Definition at line 65 of file bc_radio_pub.c.

bool bc_radio_pub_push_button ( uint16_t *  event_count)

Publish push button event count, same as use bc_radio_pub_event_count with BC_RADIO_PUB_EVENT_PUSH_BUTTON.

Parameters
[in]event_countPointer to value, can be null
Returns
true On success
false On failure

Definition at line 36 of file bc_radio_pub.c.

Here is the call graph for this function:

bool bc_radio_pub_state ( uint8_t  state_id,
bool *  state 
)

Publish battery.

Parameters
[in]state_idState id from enum BC_RADIO_PUB_STATE_*
[in]statePointer to value, can be null
Returns
true On success
false On failure

Definition at line 143 of file bc_radio_pub.c.

bool bc_radio_pub_string ( const char *  subtopic,
const char *  value 
)

Publish string value in custom topic.

Parameters
[in]subtopicSubtopic (example: node/{id}/{subtopic})
[in]valuePointer to value, can be null
Returns
true On success
false On failure

Definition at line 247 of file bc_radio_pub.c.

bool bc_radio_pub_temperature ( uint8_t  channel,
float *  celsius 
)

Publish temperature.

Parameters
[in]channelChannel id from enum BC_RADIO_PUB_CHANNEL_*
[in]celsiusPointer to value, can be null
Returns
true On success
false On failure

Definition at line 41 of file bc_radio_pub.c.

bool bc_radio_pub_uint32 ( const char *  subtopic,
uint32_t *  value 
)

Publish uint32 value in custom topic.

Parameters
[in]subtopicSubtopic (example: node/{id}/{subtopic})
[in]valuePointer to value, can be null
Returns
true On success
false On failure

Definition at line 207 of file bc_radio_pub.c.

bool bc_radio_pub_value_int ( uint8_t  value_id,
int *  value 
)

Publish int value.

Parameters
[in]value_idState id from enum BC_RADIO_PUB_VALUE_*
[in]valuePointer to value, can be null
Returns
true On success

Definition at line 155 of file bc_radio_pub.c.