Commit 0ff961fb authored by Andrei Emeltchenko's avatar Andrei Emeltchenko
Browse files

drivers/nble: Update Nordic RPC to 0425



Update RPC to Nordic BLE radio module to 0425 revision.

Change-Id: Ieb79821acd5a8fbc4358ea5e1f258834a7932c2c
Signed-off-by: default avatarAndrei Emeltchenko <andrei.emeltchenko@intel.com>
parent 6f698412
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@
#include <bluetooth/gatt.h>
#include <bluetooth/log.h>

#include "version.h"
#include "gap_internal.h"
#include "gatt_internal.h"
#include "conn_internal.h"
+9 −8
Original line number Diff line number Diff line
@@ -23,14 +23,13 @@
#include <bluetooth/conn.h>
#include <bluetooth/log.h>

#include "version.h"
#include "gap_internal.h"
#include "uart.h"
#include "conn.h"
#include "rpc.h"

/* Set the firmware compatible with Nordic BLE RPC */
static uint8_t compatible_firmware[4] = { '0', '4', '2', '2' };
static uint8_t compatible_firmware[4] = { '0', '4', '2', '5' };

#if !defined(CONFIG_NBLE_DEBUG_GAP)
#undef BT_DBG
@@ -68,17 +67,16 @@ static const char *bt_addr_le_str(const bt_addr_le_t *addr)

void on_nble_get_version_rsp(const struct nble_version_response *rsp)
{
	BT_DBG("VERSION: %d.%d.%d %.20s", rsp->version.major,
	       rsp->version.minor, rsp->version.patch,
	       rsp->version.version_string);
	BT_DBG("VERSION: %d.%d.%d %.20s", rsp->ver.major, rsp->ver.minor,
	       rsp->ver.patch, rsp->ver.version_string);

	if (memcmp(&rsp->version.version_string[sizeof(rsp->version.version_string) -
	if (memcmp(&rsp->ver.version_string[sizeof(rsp->ver.version_string) -
		   sizeof(compatible_firmware)], compatible_firmware,
		   sizeof(compatible_firmware))) {
		BT_ERR("\n\n"
		       "Incompatible firmware: %.20s, please use version %.4s"
		       "\n\n",
		       rsp->version.version_string, compatible_firmware);
		       rsp->ver.version_string, compatible_firmware);
		/* TODO: shall we allow to continue */
	}

@@ -352,6 +350,8 @@ void nble_log(const struct nble_log_s *param, char *format, uint8_t len)

void on_nble_gap_read_bda_rsp(const struct nble_service_read_bda_response *rsp)
{
	struct nble_gap_get_version_param params;

	if (rsp->status) {
		BT_ERR("Read bdaddr failed, status %d", rsp->status);
		return;
@@ -361,7 +361,8 @@ void on_nble_gap_read_bda_rsp(const struct nble_service_read_bda_response *rsp)

	BT_DBG("Local bdaddr: %s", bt_addr_le_str(&nble.addr));

	nble_get_version_req(NULL);
	params.cb = NULL;
	nble_get_version_req(&params);
}

void on_nble_common_rsp(const struct nble_response *rsp)
+19 −4
Original line number Diff line number Diff line
@@ -346,14 +346,29 @@ struct nble_uas_bucket_change {
};
void on_nble_uas_bucket_change(const struct nble_uas_bucket_change *);

void nble_get_version_req(void *user_data);
struct nble_version {
	uint8_t version;
	uint8_t major;
	uint8_t minor;
	uint8_t patch;
	char version_string[20];
	uint8_t hash[4];
};

typedef void (*ble_get_version_cb_t)(const struct nble_version *ver);

struct nble_gap_get_version_param {
	ble_get_version_cb_t cb;
};

struct nble_version_response {
	struct version_header version;
	void *user_data;
	struct nble_gap_get_version_param params;
	struct nble_version ver;
};

void on_nble_get_version_rsp(const struct nble_version_response *par);
void nble_get_version_req(const struct nble_gap_get_version_param *params);

void on_nble_get_version_rsp(const struct nble_version_response *params);

void nble_gap_dtm_init_req(void *user_data);

+0 −12
Original line number Diff line number Diff line
@@ -23,18 +23,6 @@
 */
#define BLE_GATTS_MAX_SERVICES 10

/*
 * Internal APIs used between host and BLE controller
 * Typically they are required if gatt.h APIs can not be mapped 1:1 onto
 * controller API
 */

enum BLE_GATT_IND_TYPES {
	BLE_GATT_IND_TYPE_NONE = 0,
	BLE_GATT_IND_TYPE_NOTIFICATION,
	BLE_GATT_IND_TYPE_INDICATION,
};

struct nble_gatt_register_req {
	/* Base address of the attribute table in the Quark mem space */
	struct bt_gatt_attr *attr_base;
+0 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
#endif /* CONFIG_PRINTK */

#include "rpc.h"
#include "version.h"
#include "gap_internal.h"
#include "gatt_internal.h"

Loading