Refresh C Programming
Convert void data-type (byte array) to uint8_t type static uint8_t notify_func(const void *data) { uint8_t value = ((uint8_t *)data)[7]; return value; } Structure data-type as function arguments static uint8_t notify_func(struct bt_gatt_subscribe_params *params) { printk("value_handle : %d", params->value_handle) } Declare enums as types typedef enum { STRING, NUMBERS, COMPLEX, DATATYPE_COUNT, INVALID_SENSOR } sensor_datatype_t; String initialisation to char pointer const char *p_mac_addr = "0C:8C:DC:41:E1:EF"; static void print_mac_addr(void) { printk("p_mac_addr : %s\n", p_mac_addr) } String as function return values...