Skip to content

Commit

Permalink
[BLE] Add missing flags arg to fix compile warning on write callback
Browse files Browse the repository at this point in the history
Also, tweak some formatting for readability.

Signed-off-by: Geoff Gustafson <[email protected]>
  • Loading branch information
grgustaf committed Jul 1, 2016
1 parent dc38550 commit 2613ddf
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/zjs_ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,10 @@ static bool zjs_ble_read_attr_call_function_return(const jerry_object_t *functio

static void zjs_ble_read_attr_call_function(struct zjs_callback *cb)
{
struct zjs_ble_read_callback *mycb = CONTAINER_OF(cb,
struct zjs_ble_read_callback,
zjs_cb);
struct zjs_ble_characteristic *chrc = CONTAINER_OF(mycb,
struct zjs_ble_characteristic,
read_cb);
struct zjs_ble_read_callback *mycb;
struct zjs_ble_characteristic *chrc;
mycb = CONTAINER_OF(cb, struct zjs_ble_read_callback, zjs_cb);
chrc = CONTAINER_OF(mycb, struct zjs_ble_characteristic, read_cb);

jerry_value_t rval;
jerry_value_t args[2];
Expand All @@ -166,8 +164,10 @@ static void zjs_ble_read_attr_call_function(struct zjs_callback *cb)
jerry_release_value(rval);
}

static ssize_t zjs_ble_read_attr_callback(struct bt_conn *conn, const struct bt_gatt_attr *attr,
void *buf, uint16_t len, uint16_t offset)
static ssize_t zjs_ble_read_attr_callback(struct bt_conn *conn,
const struct bt_gatt_attr *attr,
void *buf, uint16_t len,
uint16_t offset)
{
struct zjs_ble_characteristic* chrc = attr->user_data;

Expand Down Expand Up @@ -216,12 +216,10 @@ static bool zjs_ble_write_attr_call_function_return(const jerry_object_t *functi

static void zjs_ble_write_attr_call_function(struct zjs_callback *cb)
{
struct zjs_ble_write_callback *mycb = CONTAINER_OF(cb,
struct zjs_ble_write_callback,
zjs_cb);
struct zjs_ble_characteristic *chrc = CONTAINER_OF(mycb,
struct zjs_ble_characteristic,
write_cb);
struct zjs_ble_write_callback *mycb;
struct zjs_ble_characteristic *chrc;
mycb = CONTAINER_OF(cb, struct zjs_ble_write_callback, zjs_cb);
chrc = CONTAINER_OF(mycb, struct zjs_ble_characteristic, write_cb);

jerry_value_t rval;
jerry_value_t args[4];
Expand All @@ -243,7 +241,9 @@ static void zjs_ble_write_attr_call_function(struct zjs_callback *cb)
}

static ssize_t zjs_ble_write_attr_callback(struct bt_conn *conn,
const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset)
const struct bt_gatt_attr *attr,
const void *buf, uint16_t len,
uint16_t offset, uint8_t flags)
{
struct zjs_ble_characteristic* chrc = attr->user_data;

Expand Down

0 comments on commit 2613ddf

Please sign in to comment.