WIFI_EMAC class renamed to OdinWiFiEMAC, Formatting

Revert "in ODIN emac initialization required before connection"
pull/6847/head
Asif Rizwan 2018-05-18 14:15:52 +05:00 committed by Kevin Bracey
parent 7e4eb5c24b
commit 657ac3f643
20 changed files with 670 additions and 794 deletions

View File

@ -108,10 +108,8 @@ nsapi_error_t EmacTestNetworkStack::add_ethernet_interface(EMAC &emac, bool defa
{ {
// Test network stack supports only one interface // Test network stack supports only one interface
TEST_ASSERT_MESSAGE(!m_interface, "Only one interface supported!"); TEST_ASSERT_MESSAGE(!m_interface, "Only one interface supported!");
#ifdef TARGET_UBLOX_EVK_ODIN_W2
emac_if_init(); m_interface = &EmacTestNetworkStack::Interface::get_instance();
#endif
m_interface = &EmacTestNetworkStack::Interface::get_instance();
TEST_ASSERT_MESSAGE(m_interface, "Invalid interface!"); TEST_ASSERT_MESSAGE(m_interface, "Invalid interface!");
m_interface->m_emac = &emac; m_interface->m_emac = &emac;

View File

@ -19,27 +19,12 @@
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip_random.h" #include "lwip_random.h"
#if defined(DEVICE_TRNG)
#include "hal/trng_api.h"
#endif
#include "randLIB.h" #include "randLIB.h"
void lwip_seed_random(void) void lwip_seed_random(void)
{ {
#if defined(DEVICE_TRNG)
uint32_t result;
size_t olen;
trng_t trng_obj;
trng_init(&trng_obj);
trng_get_bytes(&trng_obj, (uint8_t*)&result, sizeof result, &olen);
trng_free(&trng_obj);
srand(result);
#else
randLIB_seed_random(); randLIB_seed_random();
#endif
} }
void lwip_add_random_seed(uint64_t seed) void lwip_add_random_seed(uint64_t seed)

View File

@ -12,7 +12,7 @@
#include "cb_otp.h" #include "cb_otp.h"
#include "cb_main.h" #include "cb_main.h"
#define WIFI_EMAC_MTU_SIZE (1500U) #define OdinWiFiEMAC_MTU_SIZE (1500U)
static const char _ifname[] = "WL0"; static const char _ifname[] = "WL0";
cb_boolean handleWlanTargetCopyFromDataFrame(uint8_t* buffer, cbWLANTARGET_dataFrame* frame, uint32_t size, uint32_t offsetInFrame); cb_boolean handleWlanTargetCopyFromDataFrame(uint8_t* buffer, cbWLANTARGET_dataFrame* frame, uint32_t size, uint32_t offsetInFrame);
@ -37,7 +37,7 @@ static const cbWLANTARGET_Callback _wlanTargetCallback =
void handleWlanStatusIndication(void *dummy, cbWLAN_StatusIndicationInfo status, void *data) void handleWlanStatusIndication(void *dummy, cbWLAN_StatusIndicationInfo status, void *data)
{ {
WIFI_EMAC &instance = WIFI_EMAC::get_instance(); OdinWiFiEMAC &instance = OdinWiFiEMAC::get_instance();
bool linkUp = false; bool linkUp = false;
bool sendCb = true; bool sendCb = true;
(void)dummy; (void)dummy;
@ -65,7 +65,7 @@ void handleWlanStatusIndication(void *dummy, cbWLAN_StatusIndicationInfo status,
void handleWlanPacketIndication(void *dummy, cbWLAN_PacketIndicationInfo *packetInfo) void handleWlanPacketIndication(void *dummy, cbWLAN_PacketIndicationInfo *packetInfo)
{ {
WIFI_EMAC &instance = WIFI_EMAC::get_instance(); OdinWiFiEMAC &instance = OdinWiFiEMAC::get_instance();
(void)dummy; (void)dummy;
if (instance.emac_link_input_cb) { if (instance.emac_link_input_cb) {
@ -75,17 +75,17 @@ void handleWlanPacketIndication(void *dummy, cbWLAN_PacketIndicationInfo *packet
cb_boolean handleWlanTargetCopyFromDataFrame(uint8_t* buffer, cbWLANTARGET_dataFrame* frame, uint32_t size, uint32_t offsetInFrame) cb_boolean handleWlanTargetCopyFromDataFrame(uint8_t* buffer, cbWLANTARGET_dataFrame* frame, uint32_t size, uint32_t offsetInFrame)
{ {
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager; EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
MBED_ASSERT(mem != NULL); MBED_ASSERT(mem != NULL);
//emac_mem_buf_t* phead = (emac_mem_buf_t *)frame; emac_mem_buf_t* phead = static_cast<emac_mem_buf_t *>(frame);
emac_mem_buf_t* pbuf = (emac_mem_buf_t *)frame; emac_mem_buf_t* pbuf;
uint32_t copySize, bytesCopied = 0, pbufOffset = 0; uint32_t copySize, bytesCopied = 0, pbufOffset = 0;
MBED_ASSERT(frame != NULL); MBED_ASSERT(frame != NULL);
MBED_ASSERT(buffer != NULL); MBED_ASSERT(buffer != NULL);
//pbuf = mem->get_next(phead); pbuf = phead;
while (pbuf != NULL) { while (pbuf != NULL) {
if ((pbufOffset + mem->get_len(pbuf)) >= offsetInFrame) { if ((pbufOffset + mem->get_len(pbuf)) >= offsetInFrame) {
copySize = cb_MIN(size, mem->get_len(pbuf) - (offsetInFrame - pbufOffset)); copySize = cb_MIN(size, mem->get_len(pbuf) - (offsetInFrame - pbufOffset));
@ -114,17 +114,17 @@ cb_boolean handleWlanTargetCopyFromDataFrame(uint8_t* buffer, cbWLANTARGET_dataF
cb_boolean handleWlanTargetCopyToDataFrame(cbWLANTARGET_dataFrame* frame, uint8_t* buffer, uint32_t size, uint32_t offsetInFrame) cb_boolean handleWlanTargetCopyToDataFrame(cbWLANTARGET_dataFrame* frame, uint8_t* buffer, uint32_t size, uint32_t offsetInFrame)
{ {
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager; EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
MBED_ASSERT(mem != NULL); MBED_ASSERT(mem != NULL);
//emac_mem_buf_t* phead = (emac_mem_buf_t *)frame; emac_mem_buf_t* phead = static_cast<emac_mem_buf_t *>(frame);
emac_mem_buf_t* pbuf = (emac_mem_buf_t *)frame; emac_mem_buf_t* pbuf;
uint32_t copySize, bytesCopied = 0, pbufOffset = 0; uint32_t copySize, bytesCopied = 0, pbufOffset = 0;
MBED_ASSERT(frame != NULL); MBED_ASSERT(frame != NULL);
MBED_ASSERT(buffer != NULL); MBED_ASSERT(buffer != NULL);
//pbuf = mem->get_next(phead); pbuf = phead;
while (pbuf != NULL) { while (pbuf != NULL) {
if ((pbufOffset + mem->get_len(pbuf)) >= offsetInFrame) { if ((pbufOffset + mem->get_len(pbuf)) >= offsetInFrame) {
copySize = cb_MIN(size, mem->get_len(pbuf) - (offsetInFrame - pbufOffset)); copySize = cb_MIN(size, mem->get_len(pbuf) - (offsetInFrame - pbufOffset));
@ -153,23 +153,23 @@ cb_boolean handleWlanTargetCopyToDataFrame(cbWLANTARGET_dataFrame* frame, uint8_
cbWLANTARGET_dataFrame* handleWlanTargetAllocDataFrame(uint32_t size) cbWLANTARGET_dataFrame* handleWlanTargetAllocDataFrame(uint32_t size)
{ {
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager; EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
MBED_ASSERT(mem != NULL); MBED_ASSERT(mem != NULL);
return (cbWLANTARGET_dataFrame*)mem->alloc_pool(size,0); return (cbWLANTARGET_dataFrame*)mem->alloc_pool(size, 0);
} }
void handleWlanTargetFreeDataFrame(cbWLANTARGET_dataFrame* frame) void handleWlanTargetFreeDataFrame(cbWLANTARGET_dataFrame* frame)
{ {
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager; EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
MBED_ASSERT(mem != NULL); MBED_ASSERT(mem != NULL);
mem->free((emac_mem_buf_t*)frame); mem->free(static_cast<emac_mem_buf_t *>(frame));
} }
uint32_t handleWlanTargetGetDataFrameSize(cbWLANTARGET_dataFrame* frame) uint32_t handleWlanTargetGetDataFrameSize(cbWLANTARGET_dataFrame* frame)
{ {
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager; EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
MBED_ASSERT(mem != NULL); MBED_ASSERT(mem != NULL);
return mem->get_total_len((emac_mem_buf_t*)frame); return mem->get_total_len(static_cast<emac_mem_buf_t *>(frame));
} }
uint8_t handleWlanTargetGetDataFrameTID(cbWLANTARGET_dataFrame* frame) uint8_t handleWlanTargetGetDataFrameTID(cbWLANTARGET_dataFrame* frame)
@ -178,7 +178,7 @@ uint8_t handleWlanTargetGetDataFrameTID(cbWLANTARGET_dataFrame* frame)
return (uint8_t)cbWLAN_AC_BE; return (uint8_t)cbWLAN_AC_BE;
} }
WIFI_EMAC::WIFI_EMAC() OdinWiFiEMAC::OdinWiFiEMAC()
{ {
emac_link_input_cb = NULL; emac_link_input_cb = NULL;
emac_link_state_cb = NULL; emac_link_state_cb = NULL;
@ -190,9 +190,9 @@ void send_wlan_packet(void *buf)
cbWLAN_sendPacket(buf); cbWLAN_sendPacket(buf);
} }
bool WIFI_EMAC::link_out(emac_mem_buf_t *buf) bool OdinWiFiEMAC::link_out(emac_mem_buf_t *buf)
{ {
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager; EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
// Break call chain to avoid the driver affecting stack usage for the IP stack thread too much // Break call chain to avoid the driver affecting stack usage for the IP stack thread too much
emac_mem_buf_t *new_buf = mem->alloc_pool(mem->get_total_len(buf), 0); emac_mem_buf_t *new_buf = mem->alloc_pool(mem->get_total_len(buf), 0);
@ -209,40 +209,40 @@ bool WIFI_EMAC::link_out(emac_mem_buf_t *buf)
return true; return true;
} }
bool WIFI_EMAC::power_up() bool OdinWiFiEMAC::power_up()
{ {
/* Initialize the hardware */ /* Initialize the hardware */
/* No-op at this stage */ /* No-op at this stage */
return true; return true;
} }
uint32_t WIFI_EMAC::get_mtu_size() const uint32_t OdinWiFiEMAC::get_mtu_size() const
{ {
return WIFI_EMAC_MTU_SIZE; return OdinWiFiEMAC_MTU_SIZE;
} }
void WIFI_EMAC::get_ifname(char *name, uint8_t size) const void OdinWiFiEMAC::get_ifname(char *name, uint8_t size) const
{ {
memcpy(name, _ifname, (size < sizeof(_ifname)) ? size : sizeof(_ifname)); memcpy(name, _ifname, (size < sizeof(_ifname)) ? size : sizeof(_ifname));
} }
uint8_t WIFI_EMAC::get_hwaddr_size() const uint8_t OdinWiFiEMAC::get_hwaddr_size() const
{ {
return sizeof(cbWLAN_MACAddress); return sizeof(cbWLAN_MACAddress);
} }
bool WIFI_EMAC::get_hwaddr(uint8_t *addr) const bool OdinWiFiEMAC::get_hwaddr(uint8_t *addr) const
{ {
cbOTP_read(cbOTP_MAC_WLAN, sizeof(cbWLAN_MACAddress), addr); cbOTP_read(cbOTP_MAC_WLAN, sizeof(cbWLAN_MACAddress), addr);
return true; return true;
} }
void WIFI_EMAC::set_hwaddr(const uint8_t *addr) void OdinWiFiEMAC::set_hwaddr(const uint8_t *addr)
{ {
/* No-op at this stage */ /* No-op at this stage */
} }
void WIFI_EMAC::set_link_input_cb(emac_link_input_cb_t input_cb) void OdinWiFiEMAC::set_link_input_cb(emac_link_input_cb_t input_cb)
{ {
emac_link_input_cb = input_cb; emac_link_input_cb = input_cb;
@ -251,7 +251,7 @@ void WIFI_EMAC::set_link_input_cb(emac_link_input_cb_t input_cb)
cbMAIN_driverUnlock(); cbMAIN_driverUnlock();
} }
void WIFI_EMAC::set_link_state_cb(emac_link_state_change_cb_t state_cb) void OdinWiFiEMAC::set_link_state_cb(emac_link_state_change_cb_t state_cb)
{ {
emac_link_state_cb = state_cb; emac_link_state_cb = state_cb;
@ -260,45 +260,39 @@ void WIFI_EMAC::set_link_state_cb(emac_link_state_change_cb_t state_cb)
cbMAIN_driverUnlock(); cbMAIN_driverUnlock();
} }
void WIFI_EMAC::power_down() void OdinWiFiEMAC::power_down()
{ {
/* No-op at this stage */ /* No-op at this stage */
} }
void WIFI_EMAC::set_memory_manager(EMACMemoryManager &mem_mngr) void OdinWiFiEMAC::set_memory_manager(EMACMemoryManager &mem_mngr)
{ {
memory_manager = &mem_mngr; memory_manager = &mem_mngr;
} }
uint32_t WIFI_EMAC::get_align_preference() const uint32_t OdinWiFiEMAC::get_align_preference() const
{ {
return 1; // TODO not sure if there is a requirement but don't think so return 1;
} }
void WIFI_EMAC::add_multicast_group(const uint8_t *address) void OdinWiFiEMAC::add_multicast_group(const uint8_t *address)
{ {
// TODO anything to do here for WiFi?
} }
void WIFI_EMAC::remove_multicast_group(const uint8_t *address) void OdinWiFiEMAC::remove_multicast_group(const uint8_t *address)
{ {
// TODO anything to do here for WiFi?
} }
void WIFI_EMAC::set_all_multicast(bool all) void OdinWiFiEMAC::set_all_multicast(bool all)
{ {
// TODO anything to do here for WiFi?
} }
WIFI_EMAC &WIFI_EMAC::get_instance() { OdinWiFiEMAC &OdinWiFiEMAC::get_instance() {
static WIFI_EMAC emac; static OdinWiFiEMAC emac;
return emac; return emac;
} }
// Weak so a module can override
MBED_WEAK EMAC &EMAC::get_default_instance()
{
return WIFI_EMAC::get_instance();
}
#endif // DEVICE_WIFI #endif // DEVICE_WIFI

View File

@ -9,11 +9,11 @@
#include "cb_wlan_target_data.h" #include "cb_wlan_target_data.h"
#include "cb_wlan.h" #include "cb_wlan.h"
class WIFI_EMAC : public EMAC { class OdinWiFiEMAC : public EMAC {
public: public:
WIFI_EMAC(); OdinWiFiEMAC();
static WIFI_EMAC &get_instance(); static OdinWiFiEMAC &get_instance();
/** /**
* Return maximum transmission unit * Return maximum transmission unit

View File

@ -45,11 +45,9 @@ struct wlan_scan_indication_s;
/** OdinWiFiInterface class /** OdinWiFiInterface class
* Implementation of the WiFiInterface for the ODIN-W2 module * Implementation of the WiFiInterface for the ODIN-W2 module
*/ */
#ifdef DEVICE_WIFI_AP
class OdinWiFiInterface : public WiFiInterface, public WiFiSoftAPInterface, public EMACInterface
#else
class OdinWiFiInterface : public WiFiInterface, public EMACInterface class OdinWiFiInterface : public WiFiInterface, public EMACInterface
#endif
{ {
public: public:
/** OdinWiFiInterface lifetime /** OdinWiFiInterface lifetime
@ -140,100 +138,6 @@ public:
*/ */
virtual nsapi_error_t set_timeout(int ms); virtual nsapi_error_t set_timeout(int ms);
#ifdef DEVICE_WIFI_AP
/** Set IP config for access point
*
* This function has to be called before the access point is started.
*
* @param gateway Null-terminated representation of the local gateway
* @param netmask Null-terminated representation of the network mask
* @return 0 on success, negative error code on failure
*/
//TODO: In previous WiFiInterface.h but not in new WiFiSoftAPInterface
virtual nsapi_error_t set_ap_network(const char *ip_address, const char *netmask, const char *gateway);
/** Set the WiFi network credentials
*
* @param ssid Name of the network to connect to
* @param pass Security passphrase to connect to the network
* @param security Type of encryption for connection
* (defaults to NSAPI_SECURITY_NONE)
* @return 0 on success, or error code on failure
*/
virtual nsapi_error_t set_ap_credentials(const char *ssid, const char *pass = 0,
nsapi_security_t security = NSAPI_SECURITY_NONE);
/** Set the WiFi network channel
*
* @param channel Channel on which the connection is to be made, or 0 for any (Default: 0)
* @return 0 on success, or error code on failure
*/
virtual nsapi_error_t set_ap_channel(uint8_t channel);
/** Gets the current number of active connections
*
* @return number of active connections
*/
virtual int get_ap_connection_count();
/** Gets the max supported number of active connections
*
* @return maximum number of active connections
*/
virtual int get_ap_max_connection_count();
/** Enable or disable DHCP on the network access point
*
* Enables DHCP in SoftAP mode. Defaults to enabled unless
* a static IP address has been assigned. Requires that the network is
* service stopped.
*
* @param dhcp True to enable DHCP
* @return 0 on success, negative error code on failure
*/
virtual nsapi_error_t set_ap_dhcp(bool dhcp);
/** Set the beacon interval.
*
* Note that the value needs to be set before ap_start in order to take effect.
*
* @param interval Beason interval in time units (Default: 100 time units = 102.4 ms)
* @return 0 on success, or error code on failure
*/
virtual nsapi_error_t set_ap_beacon_interval(uint16_t interval);
/** Start the interface
*
* Attempts to serve a WiFi network.
*
* @param ssid Name of the network to connect to
* @param pass Security passphrase to connect to the network
* @param security Type of encryption for connection (Default: NSAPI_SECURITY_NONE)
* @param channel Channel on which the connection is to be made, or 0 for any (Default: 0)
* @return 0 on success, or error code on failure
*/
virtual nsapi_error_t ap_start(const char *ssid, const char *pass = 0,
nsapi_security_t security = NSAPI_SECURITY_NONE, uint8_t channel = 0);
/** Start the interface
*
* Attempts to serve a WiFi network. Requires ssid to be set.
* passphrase is optional.
* If passphrase is invalid, NSAPI_ERROR_AUTH_ERROR is returned.
*
* @return 0 on success, negative error code on failure
*/
virtual nsapi_error_t ap_start();
/** Stop the interface
*
* @return 0 on success, or error code on failure
*/
virtual nsapi_error_t ap_stop();
#endif
private: private:
enum OdinWifiState { enum OdinWifiState {

View File

@ -22,10 +22,10 @@
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
/** /**
* @file cb_bt_conn_man.h * @file cb_bt_conn_man.h
* @brief Connection management. Functionality for setting up and tearing * @brief Connection management. Functionality for setting up and tearing
* down Bluetooth connections. Profile services are also enabled * down Bluetooth connections. Profile services are also enabled
* using this module. * using this module.
*/ */
#ifndef _CB_BT_CONN_MAN_H_ #ifndef _CB_BT_CONN_MAN_H_
@ -186,6 +186,7 @@ typedef cb_int32 (*cbBCM_SetMaxLinksCmd)(cb_uint32 maxLinks);
* @return TRUE if handle is free, FALSE otherwise * @return TRUE if handle is free, FALSE otherwise
*/ */
typedef cb_boolean (*cbBCM_IsHandleFree)(cbBCM_Handle handle); typedef cb_boolean (*cbBCM_IsHandleFree)(cbBCM_Handle handle);
/** /**
* Callback to indicate that remaining buffer size needs to be obtained from * Callback to indicate that remaining buffer size needs to be obtained from
* upper layer. The callback returns remaining buffer size and there is * upper layer. The callback returns remaining buffer size and there is
@ -293,7 +294,6 @@ extern cb_int32 cbBCM_enableServerProfileUuid128(
cbBCM_ConnectionCallback *pConnectionCallback, cbBCM_ConnectionCallback *pConnectionCallback,
cbBCM_ServiceClassEnabled pServiceClassEnabled); cbBCM_ServiceClassEnabled pServiceClassEnabled);
/** /**
* Registers the server role of the local device. If role is cbBCM_PAN_ROLE_NAP a service * Registers the server role of the local device. If role is cbBCM_PAN_ROLE_NAP a service
* record will be registred in the local service data base. The local device can only act as a * record will be registred in the local service data base. The local device can only act as a
@ -332,27 +332,27 @@ extern cb_int32 cbBCM_enableDeviceIdServiceRecord(
cb_uint16 vendorIdSource); cb_uint16 vendorIdSource);
/** /**
* Set Bluetooth watchdog settings * Set Bluetooth watchdog settings
* *
* @param disconnectReset Reset the device on any dropped Bluetooth connection * @param disconnectReset Reset the device on any dropped Bluetooth connection
* @return void * @return void
*/ */
extern void cbBCM_setBluetoothWatchdogValue(cb_uint32 disconnectReset); extern void cbBCM_setBluetoothWatchdogValue(cb_uint32 disconnectReset);
/** /**
* Set the packet types to use. Call cbBCM_cmdChangePacketType() * Set the packet types to use. Call cbBCM_cmdChangePacketType()
* to start using the new packet types. * to start using the new packet types.
* *
* @param packetType See packet types in bt_types.h * @param packetType See packet types in bt_types.h
* @return If the operation is successful cbBCM_OK is returned. * @return If the operation is successful cbBCM_OK is returned.
*/ */
extern cb_uint32 cbBCM_setPacketType(cb_uint16 packetType); extern cb_uint32 cbBCM_setPacketType(cb_uint16 packetType);
/** /**
* Get BT classic packet type. * Get BT classic packet type.
* *
* @return Allowed packet types returned. * @return Allowed packet types returned.
*/ */
extern cb_uint16 cbBCM_getPacketType(void); extern cb_uint16 cbBCM_getPacketType(void);
/** /**
@ -523,7 +523,7 @@ extern cbBCM_Handle cbBCM_reqConnectUuid(
* *
* @param handle Connection handle * @param handle Connection handle
* @param accept TRUE to accept the incoming connection. * @param accept TRUE to accept the incoming connection.
FALSE to reject. * FALSE to reject.
* @return If the operation is successful cbBCM_OK is returned. * @return If the operation is successful cbBCM_OK is returned.
*/ */
extern cb_int32 cbBCM_rspConnectUuidCnf( extern cb_int32 cbBCM_rspConnectUuidCnf(
@ -531,22 +531,22 @@ extern cb_int32 cbBCM_rspConnectUuidCnf(
cb_boolean accept); cb_boolean accept);
/** /**
* Initiate a Bluetooth PAN Profile connection. * Initiate a Bluetooth PAN Profile connection.
* The connection sequence includes ACL connection setup and L2CAP connection setup. * The connection sequence includes ACL connection setup and L2CAP connection setup.
* A pfConnectCnf callback will be received when the connection is complete. * A pfConnectCnf callback will be received when the connection is complete.
* The error code in the*callback is cbBCM_OK if the connection was successfully established. * The error code in the*callback is cbBCM_OK if the connection was successfully established.
* The error code in the callback is cbBCM_ERROR if the connection failed. * The error code in the callback is cbBCM_ERROR if the connection failed.
* *
* @param pAddress Pointer to address of remote device. * @param pAddress Pointer to address of remote device.
* @param remoteRole PAN role of the remote device * @param remoteRole PAN role of the remote device
* @param localRole PAN role of the local device * @param localRole PAN role of the local device
* @param pAclParams Link configuration including link supervision timeout * @param pAclParams Link configuration including link supervision timeout
* and master slave policy. Pass NULL to use default connection * and master slave policy. Pass NULL to use default connection
* parameters. * parameters.
* @param pConnectionCallback Callback structure for connection management. * @param pConnectionCallback Callback structure for connection management.
* @return If the operation is successful the connection handle is returned. If * @return If the operation is successful the connection handle is returned. If
* not cbBCM_INVALID_CONNECTION_HANDLE is returned. * not cbBCM_INVALID_CONNECTION_HANDLE is returned.
*/ */
extern cbBCM_Handle cbBCM_reqConnectPan( extern cbBCM_Handle cbBCM_reqConnectPan(
TBdAddr *pAddress, TBdAddr *pAddress,
cbBCM_PAN_Role remoteRole, cbBCM_PAN_Role remoteRole,
@ -555,14 +555,14 @@ extern cbBCM_Handle cbBCM_reqConnectPan(
cbBCM_ConnectionCallback *pConnectionCallback); cbBCM_ConnectionCallback *pConnectionCallback);
/** /**
* Accept or reject an incoming PAN connection. This is a * Accept or reject an incoming PAN connection. This is a
* response to a cbBCM_ConnectInd connection indication. * response to a cbBCM_ConnectInd connection indication.
* *
* @param handle Connection handle * @param handle Connection handle
* @param accept TRUE to accept the incoming connection. * @param accept TRUE to accept the incoming connection.
* FALSE to reject. * FALSE to reject.
* @return If the operation is successful cbBCM_OK is returned. * @return If the operation is successful cbBCM_OK is returned.
*/ */
extern cb_int32 cbBCM_rspConnectPan( extern cb_int32 cbBCM_rspConnectPan(
cbBCM_Handle handle, cbBCM_Handle handle,
cb_boolean accept); cb_boolean accept);
@ -716,11 +716,11 @@ cb_int32 cbBCM_reqServiceSearchDeviceId(
cbBCM_ServiceSearchCompleteCallback pCompleteCallback); cbBCM_ServiceSearchCompleteCallback pCompleteCallback);
/** /**
* @brief Get local Master/Slave role in an active connection. * @brief Get local Master/Slave role in an active connection.
* @param bdAddr address to the connection * @param bdAddr address to the connection
* @param roleDiscoveryCallback Callback function used to notify the role * @param roleDiscoveryCallback Callback function used to notify the role
* @return If the operation is successful cbBCM_OK is returned. * @return If the operation is successful cbBCM_OK is returned.
*/ */
extern cb_int32 cbBCM_RoleDiscovery( extern cb_int32 cbBCM_RoleDiscovery(
TBdAddr bdAddr, TBdAddr bdAddr,
cbBCM_RoleDiscoveryCallback roleDiscoveryCallback); cbBCM_RoleDiscoveryCallback roleDiscoveryCallback);
@ -737,10 +737,10 @@ extern cb_int32 cbBCM_getRssi(
cbBCM_RssiCallback rssiCallback); cbBCM_RssiCallback rssiCallback);
/* /*
* Read the LinkQuality . * Read the LinkQuality .
* @return status as int32. * @return status as int32.
* @cbBM_LinkQualityCallback is used to provide result. * @cbBM_LinkQualityCallback is used to provide result.
*/ */
extern cb_int32 cbBCM_GetLinkQuality(TBdAddr bdAddr, cbBCM_LinkQualityCallback linkQualityCallback); extern cb_int32 cbBCM_GetLinkQuality(TBdAddr bdAddr, cbBCM_LinkQualityCallback linkQualityCallback);
/** /**
@ -831,40 +831,40 @@ extern cbBCM_Handle cbBCM_getProtocolHandle(
cbBCM_Handle handle); cbBCM_Handle handle);
/** /**
* @brief Get the bcm id from acl handle for an active connection. * @brief Get the bcm id from acl handle for an active connection.
* *
* @param handle Connection handle * @param handle Connection handle
* @return bcm handle. * @return bcm handle.
*/ */
extern cbBCM_Handle cbBCM_getIdFromAclHandle(TConnHandle aclHandle); extern cbBCM_Handle cbBCM_getIdFromAclHandle(TConnHandle aclHandle);
/** /**
* @brief Get the acl handle from bcm handle. * @brief Get the acl handle from bcm handle.
* *
* @param handle bcm handle * @param handle bcm handle
* @return acl handle * @return acl handle
*/ */
extern TConnHandle cbBCM_getAclFromIdHandle(cbBCM_Handle bcmHandle); extern TConnHandle cbBCM_getAclFromIdHandle(cbBCM_Handle bcmHandle);
/** /**
* @brief Set active poll mode to introduce periodic BT classic link polling. * @brief Set active poll mode to introduce periodic BT classic link polling.
* @param mode Active poll mode 0=disable, 1=enable (default period), 2-UINT16_MAX: period of poll * @param mode Active poll mode 0=disable, 1=enable (default period), 2-UINT16_MAX: period of poll
* @return If the update is successfully initiated cbBCM_OK is returned. * @return If the update is successfully initiated cbBCM_OK is returned.
*/ */
extern cb_int32 cbBCM_setActivePollMode(cb_uint16 mode); extern cb_int32 cbBCM_setActivePollMode(cb_uint16 mode);
/** /**
* @brief Get active poll mode. * @brief Get active poll mode.
* @return Active poll mode 0=disable, 1=enable * @return Active poll mode 0=disable, 1=enable
*/ */
extern cb_uint16 cbBCM_getActivePollMode(void); extern cb_uint16 cbBCM_getActivePollMode(void);
/** /**
* @brief Change which packet types can be used for the connection identified by the handle * @brief Change which packet types can be used for the connection identified by the handle
* @param handle Connection handle * @param handle Connection handle
* @param aclPacketType bit map according to packet types defined in bt_types.h * @param aclPacketType bit map according to packet types defined in bt_types.h
* @return If the operation is successful cbBCM_OK is returned. * @return If the operation is successful cbBCM_OK is returned.
*/ */
extern cb_int32 cbBCM_changeConnectionPacketType( extern cb_int32 cbBCM_changeConnectionPacketType(
cbBCM_Handle handle, cbBCM_Handle handle,
TPacketType aclPacketType); TPacketType aclPacketType);
@ -876,9 +876,3 @@ extern cb_int32 cbBCM_changeConnectionPacketType(
#endif /* _CB_BT_CONN_MAN_H_ */ #endif /* _CB_BT_CONN_MAN_H_ */

View File

@ -156,7 +156,7 @@ typedef enum
/** /**
* Bluetooth Manager initialization parameters. * Bluetooth Manager initialization parameters.
*/ */
typedef struct typedef struct
{ {
TBdAddr address; /** Bluetooth address that shall be assigned to controller. Pass invalidBdAddress to use controller default address*/ TBdAddr address; /** Bluetooth address that shall be assigned to controller. Pass invalidBdAddress to use controller default address*/
@ -193,36 +193,36 @@ extern void cbBM_init(
cbBM_InitComplete initCompleteCallback); cbBM_InitComplete initCompleteCallback);
/** /**
* This function executes cbBM_setQosParams command according to parameters. * This function executes cbBM_setQosParams command according to parameters.
* @param connectConfig decides whether to turn off connectability and discoverability * @param connectConfig decides whether to turn off connectability and discoverability
* when max links are reached. * when max links are reached.
* @param qosConfig QoS enable=1, disable=0 * @param qosConfig QoS enable=1, disable=0
* @param connectConfig QoS "off during connection"=0, "on during connection"=1 * @param connectConfig QoS "off during connection"=0, "on during connection"=1
* @return true if in parameters are valid. * @return true if in parameters are valid.
*/ */
extern cb_int32 cbBM_setQosParams( extern cb_int32 cbBM_setQosParams(
cb_uint8 qosConfig, cb_uint8 qosConfig,
cb_uint8 connectConfig); cb_uint8 connectConfig);
/** /**
* This function sets the link supervision timeout in LLC. * This function sets the link supervision timeout in LLC.
* @param linkSupervisionTimeout in milliseconds * @param linkSupervisionTimeout in milliseconds
* @return true if in parameter is valid. * @return true if in parameter is valid.
*/ */
extern cb_int32 cbBM_setLinkSupervisionTimeout( extern cb_int32 cbBM_setLinkSupervisionTimeout(
cb_uint16 linkSupervisionTimeout); cb_uint16 linkSupervisionTimeout);
/** /**
* This function gets the link supervision timeout from LLC. * This function gets the link supervision timeout from LLC.
* @return link supervision timeout in milliseconds * @return link supervision timeout in milliseconds
*/ */
extern cb_uint16 cbBM_getLinkSupervisionTimeout(void); extern cb_uint16 cbBM_getLinkSupervisionTimeout(void);
/** /**
* This function enables or disables the fast connect feature (interlaced page scan). * This function enables or disables the fast connect feature (interlaced page scan).
* @param fastConnect enable=TRUE, disable=FALSE * @param fastConnect enable=TRUE, disable=FALSE
* @return cbBM_OK if in parameter is valid. * @return cbBM_OK if in parameter is valid.
*/ */
extern cb_int32 cbBM_setFastConnect( extern cb_int32 cbBM_setFastConnect(
cb_boolean fastConnect); cb_boolean fastConnect);
/** /**
@ -232,45 +232,45 @@ extern cb_int32 cbBM_setFastConnect(
extern cb_boolean cbBM_getFastConnect(void); extern cb_boolean cbBM_getFastConnect(void);
/** /**
* This function enables or disables the fast discovery feature (interlaced inquiry scan). * This function enables or disables the fast discovery feature (interlaced inquiry scan).
* @param fastDiscovery enable=TRUE, disable=FALSE * @param fastDiscovery enable=TRUE, disable=FALSE
* @return cbBM_OK if in parameter is valid. * @return cbBM_OK if in parameter is valid.
*/ */
extern cb_int32 cbBM_setFastDiscovery( extern cb_int32 cbBM_setFastDiscovery(
cb_boolean fastDiscovery); cb_boolean fastDiscovery);
/** /**
* This function gets whether the fast discovery feature is enabled or disabled. * This function gets whether the fast discovery feature is enabled or disabled.
* @return fast connect enabled=TRUE, disabled=FALSE * @return fast connect enabled=TRUE, disabled=FALSE
*/ */
extern cb_boolean cbBM_getFastDiscovery(void); extern cb_boolean cbBM_getFastDiscovery(void);
/** /**
* This function sets the page timeout in LLC. * This function sets the page timeout in LLC.
* @param pageTimeout in milliseconds * @param pageTimeout in milliseconds
* @return cbBM_OK if successful * @return cbBM_OK if successful
*/ */
extern cb_int32 cbBM_setPageTimeout( extern cb_int32 cbBM_setPageTimeout(
cb_uint16 pageTimeout); cb_uint16 pageTimeout);
/** /**
* This function gets the page timeout from LLC. * This function gets the page timeout from LLC.
* @return page timeout in milliseconds. * @return page timeout in milliseconds.
*/ */
extern cb_uint16 cbBM_getPageTimeout(void); extern cb_uint16 cbBM_getPageTimeout(void);
/** /**
* This function sets all default parameters for LE. * This function sets all default parameters for LE.
* This function needs to be called before the cbBM_init. * This function needs to be called before the cbBM_init.
*/ */
extern void cbBM_setDefaultValuesLeParams(void); extern void cbBM_setDefaultValuesLeParams(void);
/** /**
* This function executes HCI_cmdWrScanEnable command according to parameters. * This function executes HCI_cmdWrScanEnable command according to parameters.
* @param discoverableMode discoverable mode * @param discoverableMode discoverable mode
* @param connectableMode connectable mode * @param connectableMode connectable mode
* @return cbBM_OK if HCI command could be executed. * @return cbBM_OK if HCI command could be executed.
*/ */
extern cb_int32 cbBM_updateScan( extern cb_int32 cbBM_updateScan(
cbBM_DiscoverableMode discoverableMode, cbBM_DiscoverableMode discoverableMode,
cbBM_ConnectableMode connectableMode); cbBM_ConnectableMode connectableMode);
@ -368,17 +368,17 @@ extern cb_int32 cbBM_setMasterSlavePolicy(TMasterSlavePolicy policy);
extern cb_int32 cbBM_getMasterSlavePolicy(TMasterSlavePolicy *pPolicy); extern cb_int32 cbBM_getMasterSlavePolicy(TMasterSlavePolicy *pPolicy);
/** /**
* Enable/disable sniff mode * Enable/disable sniff mode
* @param enable TRUE=enable sniff mode, FALSE=disable sniff mode * @param enable TRUE=enable sniff mode, FALSE=disable sniff mode
* @return If the operation is successful cbBM_OK is returned. * @return If the operation is successful cbBM_OK is returned.
*/ */
extern cb_int32 cbBM_setSniffMode(cb_boolean enable); extern cb_int32 cbBM_setSniffMode(cb_boolean enable);
/** /**
* Get sniff mode * Get sniff mode
* @param pEnable Pointer to return variable * @param pEnable Pointer to return variable
* @return If the operation is successful cbBM_OK is returned. * @return If the operation is successful cbBM_OK is returned.
*/ */
extern cb_int32 cbBM_getSniffMode(cb_boolean *pEnable); extern cb_int32 cbBM_getSniffMode(cb_boolean *pEnable);
/** /**
@ -613,408 +613,408 @@ extern cb_int32 cbBM_add128BitsServiceClassLe(cb_uint8* uuid128);
extern cb_int8 cbBM_getMaxTxPower(void); extern cb_int8 cbBM_getMaxTxPower(void);
/* /*
* Read the connection parameters for Bond. * Read the connection parameters for Bond.
* @param bondParams Pointer to structure where the connection parameters are stored. * @param bondParams Pointer to structure where the connection parameters are stored.
* @return void * @return void
*/ */
void cbBM_getBondParameters(TAclParamsLe* bondParams); void cbBM_getBondParameters(TAclParamsLe* bondParams);
/* /*
* Read the connection parameters for connection. * Read the connection parameters for connection.
* @param aclParams Pointer to structure where the connection parameters are stored. * @param aclParams Pointer to structure where the connection parameters are stored.
* @return void * @return void
*/ */
void cbBM_getConnectParameters(TAclParamsLe* aclParams); void cbBM_getConnectParameters(TAclParamsLe* aclParams);
/* /*
* Read the connection parameters for remote name request. * Read the connection parameters for remote name request.
* @param aclParams Pointer to structure where the connection parameters are stored. * @param aclParams Pointer to structure where the connection parameters are stored.
* @return void * @return void
*/ */
void cbBM_getRemoteNameReqParameters(TAclParamsLe* aclParams); void cbBM_getRemoteNameReqParameters(TAclParamsLe* aclParams);
/* /*
* Read the vendor specific status of the WL18 chipset. * Read the vendor specific status of the WL18 chipset.
* @param callback Callback used to notify the completion of the * @param callback Callback used to notify the completion of the
* status request. * status request.
*@return Returns cbBM_OK if successfully started. * @return Returns cbBM_OK if successfully started.
*/ */
cb_int32 cbBM_getTISystemStatus(cbBM_TIStatusCallback callback); cb_int32 cbBM_getTISystemStatus(cbBM_TIStatusCallback callback);
/* /*
* Set BT classic as not supported in the peripheral advertisment. * Set BT classic as not supported in the peripheral advertisment.
* @param enforceDisable TRUE to set BT classic not supported * @param enforceDisable TRUE to set BT classic not supported
* @return cbBM_OK if successful * @return cbBM_OK if successful
*/ */
cb_int32 cbBM_setForceClassicNotSupportedInAdv(cb_boolean enforceDisable); cb_int32 cbBM_setForceClassicNotSupportedInAdv(cb_boolean enforceDisable);
/* /*
* Set BT classic as not supported in the peripheral advertisment. * Set BT classic as not supported in the peripheral advertisment.
* *
* @return TRUE if BT classic is set to not supported in the peripheral advertisment. * @return TRUE if BT classic is set to not supported in the peripheral advertisment.
*/ */
cb_boolean cbBM_getForceClassicNotSupportedInAdv(void); cb_boolean cbBM_getForceClassicNotSupportedInAdv(void);
/** /**
* Set min advertisment interval * Set min advertisment interval
* *
* @param newValue Minimial interval value as slots (1 slot is 0.625ms) * @param newValue Minimial interval value as slots (1 slot is 0.625ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setAdvertisingIntervalMin(cb_uint16 val); extern cb_int32 cbBM_setAdvertisingIntervalMin(cb_uint16 val);
/** /**
* Set max advertisment interval * Set max advertisment interval
* *
* @param newValue Time in slots (1 slot is 0.625ms) * @param newValue Time in slots (1 slot is 0.625ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setAdvertisingIntervalMax(cb_uint16 newValue); extern cb_int32 cbBM_setAdvertisingIntervalMax(cb_uint16 newValue);
/** /**
* Set advertisment channel map * Set advertisment channel map
* *
* @param Bit mask of channels to use; Channel 37, 38, 39 * @param Bit mask of channels to use; Channel 37, 38, 39
* (cbBM_ADV_CHANNEL_MAP_CH_37_BIT, cbBM_ADV_CHANNEL_MAP_CH_38_BIT, cbBM_ADV_CHANNEL_MAP_CH_39_BIT) * (cbBM_ADV_CHANNEL_MAP_CH_37_BIT, cbBM_ADV_CHANNEL_MAP_CH_38_BIT, cbBM_ADV_CHANNEL_MAP_CH_39_BIT)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setAdvChannelmap(cb_uint16 newValue); extern cb_int32 cbBM_setAdvChannelmap(cb_uint16 newValue);
/** /**
* Set min connection interval * Set min connection interval
* *
* @param newValue Time in slots (1 slot is 1.25ms) * @param newValue Time in slots (1 slot is 1.25ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setConnectConnIntervalMin(cb_uint16 newValue); extern cb_int32 cbBM_setConnectConnIntervalMin(cb_uint16 newValue);
/** /**
* Set max connection interval * Set max connection interval
* *
* @param newValue Time in slots (1 slot is 1.25ms) * @param newValue Time in slots (1 slot is 1.25ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setConnectConnIntervalMax(cb_uint16 newValue); extern cb_int32 cbBM_setConnectConnIntervalMax(cb_uint16 newValue);
/** /**
* Set connection latency * Set connection latency
* *
* @param newValue Time in slots (1 slot is 1.25ms) * @param newValue Time in slots (1 slot is 1.25ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setConnectConnLatency(cb_uint16 newValue); extern cb_int32 cbBM_setConnectConnLatency(cb_uint16 newValue);
/** /**
* Set link loss (or supervision) timeout * Set link loss (or supervision) timeout
* *
* @param newValue Time in ms (make sure it is larger than the connection latency) * @param newValue Time in ms (make sure it is larger than the connection latency)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setConnectLinklossTmo(cb_uint16 newValue); extern cb_int32 cbBM_setConnectLinklossTmo(cb_uint16 newValue);
/** /**
* Set create connection (or page) timeout * Set create connection (or page) timeout
* *
* @param newValue Time in ms * @param newValue Time in ms
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setConnectCreateConnTmo(cb_uint16 newValue); extern cb_int32 cbBM_setConnectCreateConnTmo(cb_uint16 newValue);
/** /**
* Set connect scan interval * Set connect scan interval
* *
* @param newValue Time in slots (1 slot is 0.625ms) * @param newValue Time in slots (1 slot is 0.625ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setConnectScanInterval(cb_uint16 newValue); extern cb_int32 cbBM_setConnectScanInterval(cb_uint16 newValue);
/** /**
* Set connect scan window * Set connect scan window
* *
* @param newValue Time in slots (1 slot is 0.625ms) * @param newValue Time in slots (1 slot is 0.625ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setConnectScanWindow(cb_uint16 newValue); extern cb_int32 cbBM_setConnectScanWindow(cb_uint16 newValue);
/** /**
* Set min bond connection interval * Set min bond connection interval
* *
* @param newValue Time in slots (1 slot is 1.25ms) * @param newValue Time in slots (1 slot is 1.25ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setBondConnIntervalMin(cb_uint16 newValue); extern cb_int32 cbBM_setBondConnIntervalMin(cb_uint16 newValue);
/** /**
* Set max bond connection interval * Set max bond connection interval
* *
* @param newValue Time in slots (1 slot is 1.25ms) * @param newValue Time in slots (1 slot is 1.25ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setBondConnIntervalMax(cb_uint16 newValue); extern cb_int32 cbBM_setBondConnIntervalMax(cb_uint16 newValue);
/** /**
* Set bond connection latency * Set bond connection latency
* *
* @param newValue Time in slots (1 slot is 1.25ms) * @param newValue Time in slots (1 slot is 1.25ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setBondConnLatency(cb_uint16 newValue); extern cb_int32 cbBM_setBondConnLatency(cb_uint16 newValue);
/** /**
* Set bond link loss (or supervision) timeout * Set bond link loss (or supervision) timeout
* *
* @param newValue Time in ms (make sure it is larger than the connection latency) * @param newValue Time in ms (make sure it is larger than the connection latency)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setBondLinklossTmo(cb_uint16 newValue); extern cb_int32 cbBM_setBondLinklossTmo(cb_uint16 newValue);
/** /**
* Set bond create connection (or page) timeout * Set bond create connection (or page) timeout
* *
* @param newValue Time in ms * @param newValue Time in ms
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setBondCreateConnTmo(cb_uint16 newValue); extern cb_int32 cbBM_setBondCreateConnTmo(cb_uint16 newValue);
/** /**
* Set bond scan interval * Set bond scan interval
* *
* @param newValue Time in slots (1 slot is 0.625ms) * @param newValue Time in slots (1 slot is 0.625ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setBondScanInterval(cb_uint16 newValue); extern cb_int32 cbBM_setBondScanInterval(cb_uint16 newValue);
/** /**
* Set bond scan window * Set bond scan window
* *
* @param newValue Time in slots (1 slot is 0.625ms) * @param newValue Time in slots (1 slot is 0.625ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setBondScanWindow(cb_uint16 newValue); extern cb_int32 cbBM_setBondScanWindow(cb_uint16 newValue);
/** /**
* Set min remote name connection interval * Set min remote name connection interval
* *
* @param newValue Time in slots (1 slot is 1.25ms) * @param newValue Time in slots (1 slot is 1.25ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setRemoteNameConnIntervalMin(cb_uint16 newValue); extern cb_int32 cbBM_setRemoteNameConnIntervalMin(cb_uint16 newValue);
/** /**
* Set max remote name connection interval * Set max remote name connection interval
* *
* @param newValue Time in slots (1 slot is 1.25ms) * @param newValue Time in slots (1 slot is 1.25ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setRemoteNameConnIntervalMax(cb_uint16 newValue); extern cb_int32 cbBM_setRemoteNameConnIntervalMax(cb_uint16 newValue);
/** /**
* Set remote name connection latency * Set remote name connection latency
* *
* @param newValue Time in slots (1 slot is 1.25ms) * @param newValue Time in slots (1 slot is 1.25ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setRemoteNameConnLatency(cb_uint16 newValue); extern cb_int32 cbBM_setRemoteNameConnLatency(cb_uint16 newValue);
/** /**
* Set remote name link loss (or supervision) timeout * Set remote name link loss (or supervision) timeout
* *
* @param newValue Time in ms (make sure it is larger than the connection latency) * @param newValue Time in ms (make sure it is larger than the connection latency)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setRemoteNameLinklossTmo(cb_uint16 newValue); extern cb_int32 cbBM_setRemoteNameLinklossTmo(cb_uint16 newValue);
/** /**
* Set remote name create connection (or page) timeout * Set remote name create connection (or page) timeout
* *
* @param newValue Time in ms * @param newValue Time in ms
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setRemoteNameCreateConnTmo(cb_uint16 newValue); extern cb_int32 cbBM_setRemoteNameCreateConnTmo(cb_uint16 newValue);
/** /**
* Set remote name scan interval * Set remote name scan interval
* *
* @param newValue Time in slots (1 slot is 0.625ms) * @param newValue Time in slots (1 slot is 0.625ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setRemoteNameScanInterval(cb_uint16 newValue); extern cb_int32 cbBM_setRemoteNameScanInterval(cb_uint16 newValue);
/** /**
* Set remote name scan window * Set remote name scan window
* *
* @param newValue Time in slots (1 slot is 0.625ms) * @param newValue Time in slots (1 slot is 0.625ms)
* @return cbBM_OK is returned on success. * @return cbBM_OK is returned on success.
*/ */
extern cb_int32 cbBM_setRemoteNameScanWindow(cb_uint16 newValue); extern cb_int32 cbBM_setRemoteNameScanWindow(cb_uint16 newValue);
/** /**
* Get min advertisment interval * Get min advertisment interval
* *
* @return Time in slots (1 slot is 0.625ms) * @return Time in slots (1 slot is 0.625ms)
*/ */
extern cb_uint16 cbBM_getAdvertisingIntervalMin(void); extern cb_uint16 cbBM_getAdvertisingIntervalMin(void);
/** /**
* Get max advertisment interval * Get max advertisment interval
* *
* @return Time in slots (1 slot is 0.625ms) * @return Time in slots (1 slot is 0.625ms)
*/ */
extern cb_uint16 cbBM_getAdvertisingIntervalMax(void); extern cb_uint16 cbBM_getAdvertisingIntervalMax(void);
/** /**
* Get advertisment channel map * Get advertisment channel map
* *
* @return Bit mask of channels to use; Channel 37, 38, 39 * @return Bit mask of channels to use; Channel 37, 38, 39
* (cbBM_ADV_CHANNEL_MAP_CH_37_BIT, cbBM_ADV_CHANNEL_MAP_CH_38_BIT, cbBM_ADV_CHANNEL_MAP_CH_39_BIT) * (cbBM_ADV_CHANNEL_MAP_CH_37_BIT, cbBM_ADV_CHANNEL_MAP_CH_38_BIT, cbBM_ADV_CHANNEL_MAP_CH_39_BIT)
*/ */
extern cb_uint16 cbBM_getAdvChannelmap(void); extern cb_uint16 cbBM_getAdvChannelmap(void);
/** /**
* Get min connection interval * Get min connection interval
* *
* @return Time in slots (1 slot is 1.25ms) * @return Time in slots (1 slot is 1.25ms)
*/ */
extern cb_uint16 cbBM_getConnectConnIntervalMin(void); extern cb_uint16 cbBM_getConnectConnIntervalMin(void);
/** /**
* Get max connection interval * Get max connection interval
* *
* @return Time in slots (1 slot is 1.25ms) * @return Time in slots (1 slot is 1.25ms)
*/ */
extern cb_uint16 cbBM_getConnectConnIntervalMax(void); extern cb_uint16 cbBM_getConnectConnIntervalMax(void);
/** /**
* Get connection latency * Get connection latency
* *
* @return Time in slots (1 slot is 1.25ms) * @return Time in slots (1 slot is 1.25ms)
*/ */
extern cb_uint16 cbBM_getConnectConnLatency(void); extern cb_uint16 cbBM_getConnectConnLatency(void);
/** /**
* Get link loss (or supervision) timeout * Get link loss (or supervision) timeout
* *
* @return Time in ms * @return Time in ms
*/ */
extern cb_uint16 cbBM_getConnectLinklossTmo(void); extern cb_uint16 cbBM_getConnectLinklossTmo(void);
/** /**
* Get create connection (or page) timeout * Get create connection (or page) timeout
* *
* @return Time in ms * @return Time in ms
*/ */
extern cb_uint16 cbBM_getConnectCreateConnTmo(void); extern cb_uint16 cbBM_getConnectCreateConnTmo(void);
/** /**
* Get connection scan interval * Get connection scan interval
* *
* @return Time in slots (1 slot is 0.625ms) * @return Time in slots (1 slot is 0.625ms)
*/ */
extern cb_uint16 cbBM_getConnectScanInterval(void); extern cb_uint16 cbBM_getConnectScanInterval(void);
/** /**
* Get connection scan window * Get connection scan window
* *
* @return Time in slots (1 slot is 0.625ms) * @return Time in slots (1 slot is 0.625ms)
*/ */
extern cb_uint16 cbBM_getConnectScanWindow(void); extern cb_uint16 cbBM_getConnectScanWindow(void);
/** /**
* Get min bond connection interval * Get min bond connection interval
* *
* @return Time in slots (1 slot is 1.25ms) * @return Time in slots (1 slot is 1.25ms)
*/ */
extern cb_uint16 cbBM_getBondConnIntervalMin(void); extern cb_uint16 cbBM_getBondConnIntervalMin(void);
/** /**
* Get bond connection interval * Get bond connection interval
* *
* @return Time in slots (1 slot is 1.25ms) * @return Time in slots (1 slot is 1.25ms)
*/ */
extern cb_uint16 cbBM_getBondConnIntervalMax(void); extern cb_uint16 cbBM_getBondConnIntervalMax(void);
/** /**
* Get bond connection latency * Get bond connection latency
* *
* @return Time in slots (1 slot is 1.25ms) * @return Time in slots (1 slot is 1.25ms)
*/ */
extern cb_uint16 cbBM_getBondConnLatency(void); extern cb_uint16 cbBM_getBondConnLatency(void);
/** /**
* Get bond link loss (or supervision) timeout * Get bond link loss (or supervision) timeout
* *
* @return Time in ms * @return Time in ms
*/ */
extern cb_uint16 cbBM_getBondLinklossTmo(void); extern cb_uint16 cbBM_getBondLinklossTmo(void);
/** /**
* Get bond connection (or page) timeout * Get bond connection (or page) timeout
* *
* @return Time in ms * @return Time in ms
*/ */
extern cb_uint16 cbBM_getBondCreateConnTmo(void); extern cb_uint16 cbBM_getBondCreateConnTmo(void);
/** /**
* Get bond scan interval * Get bond scan interval
* *
* @return Time in slots (1 slot is 0.625ms) * @return Time in slots (1 slot is 0.625ms)
*/ */
extern cb_uint16 cbBM_getBondScanInterval(void); extern cb_uint16 cbBM_getBondScanInterval(void);
/** /**
* Get bond scan window * Get bond scan window
* *
* @return Time in slots (1 slot is 0.625ms) * @return Time in slots (1 slot is 0.625ms)
*/ */
extern cb_uint16 cbBM_getBondScanWindow(void); extern cb_uint16 cbBM_getBondScanWindow(void);
/** /**
* Get min remote name connection interval * Get min remote name connection interval
* *
* @return Time in slots (1 slot is 1.25ms) * @return Time in slots (1 slot is 1.25ms)
*/ */
extern cb_uint16 cbBM_getRemoteNameConnIntervalMin(void); extern cb_uint16 cbBM_getRemoteNameConnIntervalMin(void);
/** /**
* Get max remote name connection interval * Get max remote name connection interval
* *
* @return Time in slots (1 slot is 1.25ms) * @return Time in slots (1 slot is 1.25ms)
*/ */
extern cb_uint16 cbBM_getRemoteNameConnIntervalMax(void); extern cb_uint16 cbBM_getRemoteNameConnIntervalMax(void);
/** /**
* Get remote name connection latency * Get remote name connection latency
* *
* @return Time in slots (1 slot is 1.25ms) * @return Time in slots (1 slot is 1.25ms)
*/ */
extern cb_uint16 cbBM_getRemoteNameConnLatency(void); extern cb_uint16 cbBM_getRemoteNameConnLatency(void);
/** /**
* Get remote name link loss (or supervision) timeout * Get remote name link loss (or supervision) timeout
* *
* @return Time in ms * @return Time in ms
*/ */
extern cb_uint16 cbBM_getRemoteNameLinklossTmo(void); extern cb_uint16 cbBM_getRemoteNameLinklossTmo(void);
/** /**
* Get remote name connection (or page) timeout * Get remote name connection (or page) timeout
* *
* @return Time in ms * @return Time in ms
*/ */
extern cb_uint16 cbBM_getRemoteNameCreateConnTmo(void); extern cb_uint16 cbBM_getRemoteNameCreateConnTmo(void);
/** /**
* Get remote name scan interval * Get remote name scan interval
* *
* @return Time in slots (1 slot is 0.625ms) * @return Time in slots (1 slot is 0.625ms)
*/ */
extern cb_uint16 cbBM_getRemoteNameScanInterval(void); extern cb_uint16 cbBM_getRemoteNameScanInterval(void);
/** /**
* Get remote name scan window * Get remote name scan window
* *
* @return Time in slots (1 slot is 0.625ms) * @return Time in slots (1 slot is 0.625ms)
*/ */
extern cb_uint16 cbBM_getRemoteNameScanWindow(void); extern cb_uint16 cbBM_getRemoteNameScanWindow(void);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -1,5 +1,5 @@
/** /**
*--------------------------------------------------------------------------- *---------------------------------------------------------------------------
* Copyright (c) 2016, u-blox Malmö, All Rights Reserved * Copyright (c) 2016, u-blox Malmö, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL * SPDX-License-Identifier: LicenseRef-PBL
* *
@ -33,8 +33,8 @@ extern "C" {
#endif #endif
/*=========================================================================== /*===========================================================================
* DEFINES * DEFINES
*=========================================================================*/ *=========================================================================*/
#define cbBTPAN_RESULT_OK ((cb_int32)0x00000000) #define cbBTPAN_RESULT_OK ((cb_int32)0x00000000)
#define cbBTPAN_RESULT_ERROR ((cb_int32)0x00000001) #define cbBTPAN_RESULT_ERROR ((cb_int32)0x00000001)
#define cbBTPAN_RESULT_ILLEGAL_HANDLE ((cb_int32)0x00000002) #define cbBTPAN_RESULT_ILLEGAL_HANDLE ((cb_int32)0x00000002)
@ -42,49 +42,49 @@ extern "C" {
#define cbBTPAN_RESULT_LINK_LOSS ((cb_int32)0x00000004) #define cbBTPAN_RESULT_LINK_LOSS ((cb_int32)0x00000004)
/*=========================================================================== /*===========================================================================
* TYPES * TYPES
*=========================================================================*/ *=========================================================================*/
typedef cb_uint32 cbBTPAN_Handle; typedef cb_uint32 cbBTPAN_Handle;
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
* Callback to indicate that a Bnep connection has been established. * Callback to indicate that a Bnep connection has been established.
* *
* @param connHandle: Connection handle * @param connHandle: Connection handle
* @param info: Information about the connection * @param info: Information about the connection
* *
* @return None * @return None
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
typedef void(*cbBTPAN_ConnectEvt) (cbBCM_Handle connHandle, cbBCM_ConnectionInfo info); typedef void(*cbBTPAN_ConnectEvt) (cbBCM_Handle connHandle, cbBCM_ConnectionInfo info);
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
* Callback to indicate that a Bnep connection has been disconnected. * Callback to indicate that a Bnep connection has been disconnected.
* *
* @param connHandle: Connection handle * @param connHandle: Connection handle
* *
* @return None * @return None
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
typedef void(*cbBTPAN_DisconnectEvt) (cbBCM_Handle connHandle); typedef void(*cbBTPAN_DisconnectEvt) (cbBCM_Handle connHandle);
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
* Callback to indicate that data has been received from remote device. * Callback to indicate that data has been received from remote device.
* *
* @param btPanHandle: PAN handle * @param btPanHandle: PAN handle
* @param length: Length of the data * @param length: Length of the data
* @param pData: Pointer to the data * @param pData: Pointer to the data
* *
* @return None * @return None
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
typedef void(*cbBTPAN_DataEvt) (cbBCM_Handle connHandle, cb_uint8* pData, cb_uint16 length); typedef void(*cbBTPAN_DataEvt) (cbBCM_Handle connHandle, cb_uint8 * pData, cb_uint16 length);
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
* Callback to indicate that data has been taken care by PAN. New * Callback to indicate that data has been taken care by PAN. New
* data can now be sent on this handle. * data can now be sent on this handle.
* *
* @param btPanHandle: PAN handle * @param btPanHandle: PAN handle
* @param result: cbBTPAN_RESULT_OK if the data sending succeeded * @param result: cbBTPAN_RESULT_OK if the data sending succeeded
* *
* @return None * @return None
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
typedef void(*cbBTPAN_DataCnf) (cbBCM_Handle connHandle, cb_int32 result); typedef void(*cbBTPAN_DataCnf) (cbBCM_Handle connHandle, cb_int32 result);
typedef struct typedef struct
@ -93,46 +93,46 @@ typedef struct
cbBTPAN_DisconnectEvt pfDisconnectEvt; cbBTPAN_DisconnectEvt pfDisconnectEvt;
cbBTPAN_DataEvt pfDataEvt; cbBTPAN_DataEvt pfDataEvt;
cbBTPAN_DataCnf pfWriteCnf; cbBTPAN_DataCnf pfWriteCnf;
}cbBTPAN_Callback; } cbBTPAN_Callback;
/*=========================================================================== /*===========================================================================
* FUNCTIONS * FUNCTIONS
*=========================================================================*/ *=========================================================================*/
/** /**
* Initialization of Bluetooth PAN data. Called during stack * Initialization of Bluetooth PAN data. Called during stack
* initialization. Shall not be called by application. * initialization. Shall not be called by application.
* *
* @return None * @return None
*/ */
extern void cbBTPAN_init(void); extern void cbBTPAN_init(void);
/** /**
* Registers for PAN data callbacks. Only one registration is supported. * Registers for PAN data callbacks. Only one registration is supported.
* *
* @param pDataCallback Data callback * @param pDataCallback Data callback
* *
* @return cbBTPAN_RESULT_OK if successful * @return cbBTPAN_RESULT_OK if successful
*/ */
extern cb_uint32 cbBTPAN_registerDataCallback(cbBTPAN_Callback* pDataCallback); extern cb_uint32 cbBTPAN_registerDataCallback(cbBTPAN_Callback * pDataCallback);
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
* Sends data to the remote device. Note that you have to wait for the * Sends data to the remote device. Note that you have to wait for the
* confirmation callback (cbBTPAN_DataCnf) before calling another cbBTPAN_reqData. * confirmation callback (cbBTPAN_DataCnf) before calling another cbBTPAN_reqData.
* *
* @param connHandle: Connection handle * @param connHandle: Connection handle
* @param pBuf: Pointer to the data * @param pBuf: Pointer to the data
* @param bufSize: Length of the data * @param bufSize: Length of the data
* *
* @return cbBTPAN_RESULT_OK if successful * @return cbBTPAN_RESULT_OK if successful
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
extern cb_int32 cbBTPAN_reqData(cbBCM_Handle connHandle, cb_uint8* pBuf, cb_uint16 bufSize); extern cb_int32 cbBTPAN_reqData(cbBCM_Handle connHandle, cb_uint8 * pBuf, cb_uint16 bufSize);
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
* Gets the max frame size that can be sent/received with * Gets the max frame size that can be sent/received with
* cbBTPAN_reqData/pfDataEvt * cbBTPAN_reqData/pfDataEvt
* *
* @return max frame size * @return max frame size
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
extern cb_int32 cbBTPAN_getMaxFrameSize(void); extern cb_int32 cbBTPAN_getMaxFrameSize(void);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -366,13 +366,14 @@ extern cb_int32 cbBSM_deleteBondedDevice(TBdAddr* pBdAddress);
extern cb_int32 cbBSM_deleteAllBondedDevices(void); extern cb_int32 cbBSM_deleteAllBondedDevices(void);
/** /**
* Initializes the static Link Keys for both classic and LE. * Initializes the static Link Keys for both classic and LE.
* nvdsId: nvds id for the static link key, * nvdsId: nvds id for the static link key,
* (0) disables the use of a static link key. * (0) disables the use of a static link key.
* *
* @return cbBSM_OK. * @return cbBSM_OK.
*/ */
cb_int32 cbBSM_setStaticLinkKeyNvdsId(cb_int32 nvdsId); cb_int32 cbBSM_setStaticLinkKeyNvdsId(cb_int32 nvdsId);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -63,11 +63,12 @@ typedef struct
{ {
cbBSE_DataAvailEvt pfDataEvt; cbBSE_DataAvailEvt pfDataEvt;
cbBSE_WriteCnf pfWriteCnf; cbBSE_WriteCnf pfWriteCnf;
}cbBSE_Callback; } cbBSE_Callback;
/*=========================================================================== /*===========================================================================
* FUNCTIONS * FUNCTIONS
*=========================================================================*/ *=========================================================================*/
/** /**
* Initialization of Bluetooth serial manager. Called during stack * Initialization of Bluetooth serial manager. Called during stack
* initialization. Shall not be called by application. * initialization. Shall not be called by application.

View File

@ -61,11 +61,12 @@ typedef struct
{ {
cbBSL_DataAvailEvt pfDataEvt; cbBSL_DataAvailEvt pfDataEvt;
cbBSL_WriteCnf pfWriteCnf; cbBSL_WriteCnf pfWriteCnf;
}cbBSL_Callback; } cbBSL_Callback;
/*=========================================================================== /*===========================================================================
* FUNCTIONS * FUNCTIONS
*=========================================================================*/ *=========================================================================*/
/** /**
* Initialization of Bluetooth serial manager. Called during stack * Initialization of Bluetooth serial manager. Called during stack
* initialization. Shall not be called by application. * initialization. Shall not be called by application.

View File

@ -55,12 +55,12 @@ typedef cb_uint32 cbCERT_StreamPosition;
* @ingroup wlan * @ingroup wlan
*/ */
struct cbCERT_Stream_s { struct cbCERT_Stream_s {
cb_int32(*read)(const cbCERT_Stream *stream, void *buf, cb_uint32 count); /**< Read function pointer, place count bytes in buf. */ cb_int32(*read)(const cbCERT_Stream *stream, void *buf, cb_uint32 count); /**< Read function pointer, place count bytes in buf. */
cb_int32(*write)(const cbCERT_Stream *stream, void *buf, cb_uint32 count); /**< Read function pointer, place count bytes in buf. */ cb_int32(*write)(const cbCERT_Stream *stream, void *buf, cb_uint32 count); /**< Read function pointer, place count bytes in buf. */
void(*rewind)(const cbCERT_Stream *stream); /**< Rewind function pointer, rewind stream internal iterator to the beginning. Mandatory for all streams. */ void(*rewind)(const cbCERT_Stream *stream); /**< Rewind function pointer, rewind stream internal iterator to the beginning. Mandatory for all streams. */
void(*setPosition)(const cbCERT_Stream *stream, cbCERT_StreamPosition position); /**< Set absolute position. */ void(*setPosition)(const cbCERT_Stream *stream, cbCERT_StreamPosition position); /**< Set absolute position. */
cbCERT_StreamPosition(*getPosition)(const cbCERT_Stream *stream); /**< Get current position. */ cbCERT_StreamPosition(*getPosition)(const cbCERT_Stream *stream); /**< Get current position. */
cb_uint32(*getSize)(const cbCERT_Stream *stream); /**< GetSize function pointer, return total size of stream contents. */ cb_uint32(*getSize)(const cbCERT_Stream *stream); /**< GetSize function pointer, return total size of stream contents. */
}; };
/*=========================================================================== /*===========================================================================

View File

@ -52,7 +52,7 @@ typedef enum {
cbHW_RESET_REASON_UNKNOWN = 0, cbHW_RESET_REASON_UNKNOWN = 0,
cbHW_RESET_REASON_FW_UPDATE, cbHW_RESET_REASON_FW_UPDATE,
cbHW_RESET_REASON_PRODUCTION_MODE cbHW_RESET_REASON_PRODUCTION_MODE
}cbHW_ResetReason; } cbHW_ResetReason;
typedef enum { typedef enum {
cbHW_FLOW_CONTROL_DISABLED = 0, cbHW_FLOW_CONTROL_DISABLED = 0,
@ -64,7 +64,7 @@ typedef enum {
cbHW_IRQ_MEDIUM = 3U, cbHW_IRQ_MEDIUM = 3U,
cbHW_IRQ_DEFAULT = 5U, cbHW_IRQ_DEFAULT = 5U,
cbHW_IRQ_LOW = 12U cbHW_IRQ_LOW = 12U
}cbHW_PRIO_LVL; } cbHW_PRIO_LVL;
typedef enum { typedef enum {
cbHW_SYSTICK_DISABLED, cbHW_SYSTICK_DISABLED,
@ -74,7 +74,7 @@ typedef enum {
typedef enum { typedef enum {
cbHW_HASH_MD5 cbHW_HASH_MD5
}cbHW_HashType; } cbHW_HashType;
/*=========================================================================== /*===========================================================================
* TYPES * TYPES
*=========================================================================*/ *=========================================================================*/

View File

@ -56,8 +56,8 @@ typedef struct
} cbMAIN_WlanStartParams; } cbMAIN_WlanStartParams;
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
* Callback to indicate that initialization of BT stack is completed. * Callback to indicate that initialization of BT stack is completed.
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
typedef void(*cbMAIN_initBtComplete)(void); typedef void(*cbMAIN_initBtComplete)(void);
/*=========================================================================== /*===========================================================================
@ -65,81 +65,81 @@ typedef void(*cbMAIN_initBtComplete)(void);
*=========================================================================*/ *=========================================================================*/
/** /**
* Initialize OS, timers, GPIO's, heap and OTP. * Initialize OS, timers, GPIO's, heap and OTP.
* *
* @return void * @return void
*/ */
extern void cbMAIN_initOS(void); extern void cbMAIN_initOS(void);
/** /**
* Start Bluetooth HW. * Start Bluetooth HW.
* *
* @param pInitParameters Initial configuration parameters. These parameters can * @param pInitParameters Initial configuration parameters. These parameters can
* not be changed once Bluetooth has been started. * not be changed once Bluetooth has been started.
* @param callback Will be invoked when initialisation is done. * @param callback Will be invoked when initialisation is done.
* @return void * @return void
*/ */
extern void cbMAIN_initBt(cbMAIN_BtInitParams *pInitParameters, cbMAIN_initBtComplete callback); extern void cbMAIN_initBt(cbMAIN_BtInitParams *pInitParameters, cbMAIN_initBtComplete callback);
/** /**
* Initialize WLAN component. * Initialize WLAN component.
* @return Port specific TARGET identifier * @return Port specific TARGET identifier
*/ */
extern cb_int32 cbMAIN_initWlan(void); extern cb_int32 cbMAIN_initWlan(void);
/** /**
* Start WLAN component. * Start WLAN component.
* Create WLAN driver instance, bind it to targetId and start the driver. * Create WLAN driver instance, bind it to targetId and start the driver.
* *
* @param targetId Port specific TARGET identifier. * @param targetId Port specific TARGET identifier.
* @param params Start parameters passed to WLAN driver instance. * @param params Start parameters passed to WLAN driver instance.
* @return cbSTATUS_OK if successful, otherwise cbSTATUS_ERROR. * @return cbSTATUS_OK if successful, otherwise cbSTATUS_ERROR.
*/ */
extern cb_int32 cbMAIN_startWlan(cb_int32 targetId, cbMAIN_WlanStartParams *params); extern cb_int32 cbMAIN_startWlan(cb_int32 targetId, cbMAIN_WlanStartParams *params);
/** /**
* Register error handler function. * Register error handler function.
* *
* @param errHandler Function to be invoked in case of error. * @param errHandler Function to be invoked in case of error.
* @return void * @return void
*/ */
extern void cbMAIN_registerErrorHandler(cbMAIN_ErrorHandler errHandler); extern void cbMAIN_registerErrorHandler(cbMAIN_ErrorHandler errHandler);
/** /**
* Start driver OS. This must be called after all cbMAIN_initOS/cbMAIN_initBt/cbMAIN_initWlan * Start driver OS. This must be called after all cbMAIN_initOS/cbMAIN_initBt/cbMAIN_initWlan
* to start the driver thread. * to start the driver thread.
* *
* @return void * @return void
*/ */
extern void cbMAIN_startOS(void); extern void cbMAIN_startOS(void);
/** /**
* Get event queue. Used for running a function in the same thread context as the driver. * Get event queue. Used for running a function in the same thread context as the driver.
* Can not be called before cbMAIN_initOS/cbMAIN_initBt/cbMAIN_initWlan. * Can not be called before cbMAIN_initOS/cbMAIN_initBt/cbMAIN_initWlan.
* Use cbMAIN_dispatchEventQueue to trigger the driver to call the queued up functions. * Use cbMAIN_dispatchEventQueue to trigger the driver to call the queued up functions.
* @return EventQueue Pointer to the event queue where function calls can be enqueued. * @return EventQueue Pointer to the event queue where function calls can be enqueued.
*/ */
extern EventQueue* cbMAIN_getEventQueue(void); extern EventQueue* cbMAIN_getEventQueue(void);
/** /**
* Lock driver from usage. This must be used if a C API function is used outside of the driver thread context. * Lock driver from usage. This must be used if a C API function is used outside of the driver thread context.
* The driver should only be locked for as small time as possible. * The driver should only be locked for as small time as possible.
* @return void * @return void
*/ */
extern void cbMAIN_driverLock(void); extern void cbMAIN_driverLock(void);
/** /**
* Unlock driver. used when the C API function has finished executing to release the driver for others to use. * Unlock driver. used when the C API function has finished executing to release the driver for others to use.
* *
* @return void * @return void
*/ */
extern void cbMAIN_driverUnlock(void); extern void cbMAIN_driverUnlock(void);
/** /**
* Dispatch event queue. Should be called to trigger calls that have been queued up in the driver context * Dispatch event queue. Should be called to trigger calls that have been queued up in the driver context
* *
* @return void * @return void
*/ */
extern void cbMAIN_dispatchEventQueue(void); extern void cbMAIN_dispatchEventQueue(void);
#endif /*_CB_MAIN_H_*/ #endif /*_CB_MAIN_H_*/

View File

@ -90,8 +90,8 @@ cbTARGET_Handle *cbTARGET_targetResolve(cb_int32 targetId);
void cbTARGET_reset(cbTARGET_Handle *hTarget); void cbTARGET_reset(cbTARGET_Handle *hTarget);
/** /**
* Register a interrupt handler with the TARGET. * Register a interrupt handler with the TARGET.
*/ */
void cbTARGET_registerISRHandler(cbTARGET_Handle *hTarget, cbTARGET_ISRHandler handler, void* hContext); void cbTARGET_registerISRHandler(cbTARGET_Handle *hTarget, cbTARGET_ISRHandler handler, void* hContext);

View File

@ -41,27 +41,27 @@ extern "C" {
*=========================================================================*/ *=========================================================================*/
/** /**
* Put watchdog in a defined state. * Put watchdog in a defined state.
*/ */
void cbWD_init(void); void cbWD_init(void);
/** /**
* Resets the CPU. * Resets the CPU.
*/ */
void cbWD_systemReset(void); void cbWD_systemReset(void);
/** /**
* Enables watchdog. Watchdog needs to be polled using cbWD_poll() with * Enables watchdog. Watchdog needs to be polled using cbWD_poll() with
* shorter intervals then specified by timeInMilliseconds. * shorter intervals then specified by timeInMilliseconds.
* *
* @param timeInMilliseconds Watchdog timeout in milliseconds. * @param timeInMilliseconds Watchdog timeout in milliseconds.
*/ */
void cbWD_enable(cb_uint32 timeInMilliseconds); void cbWD_enable(cb_uint32 timeInMilliseconds);
/** /**
* Poll the watchdog timer. This must be done with shorter intervalls * Poll the watchdog timer. This must be done with shorter intervalls
* than the time in cbWD_enable(). * than the time in cbWD_enable().
*/ */
void cbWD_poll(void); void cbWD_poll(void);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -73,10 +73,10 @@ extern "C" {
#define cbWLAN_MAX_DOMAIN_LENGTH 64 #define cbWLAN_MAX_DOMAIN_LENGTH 64
/** /**
* Size of the misc buffer in @ref cbWM_ChangeBSS and @ref cbWM_StartFT. * Size of the misc buffer in @ref cbWM_ChangeBSS and @ref cbWM_StartFT.
* *
* @ingroup types * @ingroup types
*/ */
#define MISC_BUFFER_SIZE 255 #define MISC_BUFFER_SIZE 255
#define cbWLAN_FTIE_SIZE 255 #define cbWLAN_FTIE_SIZE 255
@ -86,6 +86,7 @@ extern "C" {
/*=========================================================================== /*===========================================================================
* TYPES * TYPES
*=========================================================================*/ *=========================================================================*/
/** /**
* Start parameters passed to WLAN driver. * Start parameters passed to WLAN driver.
* *
@ -140,8 +141,6 @@ typedef struct cbWLAN_WPAPSK {
*/ */
typedef struct cbWLAN_WPAPSKConnectParameters { typedef struct cbWLAN_WPAPSKConnectParameters {
cbWLAN_WPAPSK psk; /**< WPA pre-shared key*/ cbWLAN_WPAPSK psk; /**< WPA pre-shared key*/
#if defined(CB_FEATURE_802DOT11W)
#endif
} cbWLAN_WPAPSKConnectParameters; } cbWLAN_WPAPSKConnectParameters;
#if defined(CB_FEATURE_802DOT11R) #if defined(CB_FEATURE_802DOT11R)
@ -157,7 +156,7 @@ typedef struct cbWLAN_AssociateInformationElements{
cb_uint32 mdIeLen; cb_uint32 mdIeLen;
cb_uint8 ftIe[cbWLAN_FTIE_SIZE]; cb_uint8 ftIe[cbWLAN_FTIE_SIZE];
cb_uint32 ftIeLen; cb_uint32 ftIeLen;
}cbWLAN_AssociateInformationElements; } cbWLAN_AssociateInformationElements;
#endif #endif
#if defined(CB_FEATURE_802DOT11W) #if defined(CB_FEATURE_802DOT11W)
@ -200,7 +199,7 @@ typedef struct cbWLAN_CommonApParameters {
cbWLAN_RateMask basicRates; /**< Basic rates. */ cbWLAN_RateMask basicRates; /**< Basic rates. */
cbWLAN_RateMask allowedRates; /**< BSS allowed rates. */ cbWLAN_RateMask allowedRates; /**< BSS allowed rates. */
cb_uint8 dtimInterval; /**< Dtim Interval. */ cb_uint8 dtimInterval; /**< Dtim Interval. */
}cbWLAN_CommonApParameters; } cbWLAN_CommonApParameters;
/** /**

View File

@ -49,10 +49,10 @@ extern "C" {
#define cbTARGET_GSETTING_4_ADDRESS_MODE_STATION_DYNAMIC cb_BIT_0 #define cbTARGET_GSETTING_4_ADDRESS_MODE_STATION_DYNAMIC cb_BIT_0
#define cbTARGET_GSETTING_4_ADDRESS_MODE_STATION_ALWAYS cb_BIT_1 #define cbTARGET_GSETTING_4_ADDRESS_MODE_STATION_ALWAYS cb_BIT_1
/** /**
* General settings and tuning parameters . * General settings and tuning parameters .
* *
* @ingroup types * @ingroup types
*/ */
typedef enum wm_gsetting_e { typedef enum wm_gsetting_e {
cbTARGET_GSETTING_START = 0, cbTARGET_GSETTING_START = 0,
cbTARGET_GSETTING_PREAMBLE = cbTARGET_GSETTING_START, /**< 0 = Long preamble, 1 = Short preamble */ cbTARGET_GSETTING_PREAMBLE = cbTARGET_GSETTING_START, /**< 0 = Long preamble, 1 = Short preamble */
@ -123,15 +123,15 @@ typedef enum targetConfigParams {
cbTARGET_CFG_SET_TSETTING = 2000, //!< Pipe to @ref cbWM_tSet. cbTARGET_CFG_SET_TSETTING = 2000, //!< Pipe to @ref cbWM_tSet.
cbTARGET_CFG_GET_GSETTING = 3000, //!< Pipe to @ref cbWM_gGet. cbTARGET_CFG_GET_GSETTING = 3000, //!< Pipe to @ref cbWM_gGet.
cbTARGET_CFG_GET_TSETTING = 4000, //!< Pipe to @ref cbWM_tGet. cbTARGET_CFG_GET_TSETTING = 4000, //!< Pipe to @ref cbWM_tGet.
}cbTARGET_ConfigParams; } cbTARGET_ConfigParams;
#define cbTARGET_GSETTING_REG(X) ((cb_uint32)((X) - cbTARGET_GSETTING_START)) #define cbTARGET_GSETTING_REG(X) ((cb_uint32)((X) - cbTARGET_GSETTING_START))
/** /**
* Target specific settings and tuning parameters . * Target specific settings and tuning parameters .
* *
* @ingroup types * @ingroup types
*/ */
typedef enum wm_tsetting_e { typedef enum wm_tsetting_e {
cbTARGET_TSETTING_START = 1000, cbTARGET_TSETTING_START = 1000,
cbTARGET_TSETTING_PS_LISTEN_INTERVAL = cbTARGET_TSETTING_START, /**< Powersave: Listen interval in beacons. */ cbTARGET_TSETTING_PS_LISTEN_INTERVAL = cbTARGET_TSETTING_START, /**< Powersave: Listen interval in beacons. */
@ -145,13 +145,13 @@ typedef enum wm_tsetting_e {
#define cbTARGET_TSETTING_REG(X) ((cb_uint32)((X) - cbTARGET_TSETTING_START)) #define cbTARGET_TSETTING_REG(X) ((cb_uint32)((X) - cbTARGET_TSETTING_START))
/** /**
* Defines the type of scanning procedure. * Defines the type of scanning procedure.
* Passive scan will only listen for beacons. * Passive scan will only listen for beacons.
* Active scan will send out a probe request * Active scan will send out a probe request
* and listen for both probe responses and beacons. * and listen for both probe responses and beacons.
* *
* @ingroup types * @ingroup types
*/ */
typedef enum cbWM_ScanType_e { typedef enum cbWM_ScanType_e {
cbWM_SCAN_INVALID, cbWM_SCAN_INVALID,
cbWM_SCAN_ACTIVE, cbWM_SCAN_ACTIVE,
@ -159,11 +159,11 @@ typedef enum cbWM_ScanType_e {
} cbWM_ScanType; } cbWM_ScanType;
/** /**
* Power save levels. * Power save levels.
* @note Levels between 2 and cbWM_POWERSAVE_MAX are target specific. * @note Levels between 2 and cbWM_POWERSAVE_MAX are target specific.
* *
* @ingroup types * @ingroup types
*/ */
typedef enum cbWM_PowerSaveType_e { typedef enum cbWM_PowerSaveType_e {
cbWM_POWERSAVE_OFF = 0, cbWM_POWERSAVE_OFF = 0,
cbWM_POWERSAVE_FAST_PSP = 1, cbWM_POWERSAVE_FAST_PSP = 1,
@ -172,10 +172,10 @@ typedef enum cbWM_PowerSaveType_e {
} cbWM_PowerSaveType; } cbWM_PowerSaveType;
/** /**
* Power save modes set using @ref cbWLAN_ioctl * Power save modes set using @ref cbWLAN_ioctl
* *
* @ingroup wlan * @ingroup wlan
*/ */
typedef enum { typedef enum {
cbTARGET_POWER_SAVE_MODE_OFF, cbTARGET_POWER_SAVE_MODE_OFF,
cbTARGET_POWER_SAVE_MODE_SLEEP, cbTARGET_POWER_SAVE_MODE_SLEEP,
@ -185,57 +185,56 @@ typedef enum {
typedef enum { typedef enum {
cbWLAN_ONE_ANTENNA = 1, cbWLAN_ONE_ANTENNA = 1,
cbWLAN_TWO_ANTENNAS cbWLAN_TWO_ANTENNAS
}cbWLAN_NUMBER_OF_ANTENNAS; } cbWLAN_NUMBER_OF_ANTENNAS;
typedef enum { typedef enum {
cbWLAN_PRIMARY_ANTENNA_ONE = 1, cbWLAN_PRIMARY_ANTENNA_ONE = 1,
cbWLAN_PRIMARY_ANTENNA_TWO cbWLAN_PRIMARY_ANTENNA_TWO
}cbWLAN_PRIMARY_ANTENNA; } cbWLAN_PRIMARY_ANTENNA;
/*=========================================================================== /*===========================================================================
* FUNCTIONS * FUNCTIONS
*=========================================================================*/ *=========================================================================*/
/** /**
* Get general tuning parameter. * Get general tuning parameter.
* *
* @param hTarget Handle to the current driver instance. * @param hTarget Handle to the current driver instance.
* @param setting setting to read. * @param setting setting to read.
* @return parameter value * @return parameter value
*/ */
cb_uint32 cbTARGET_gGet(cbTARGET_Handle* hTarget, cbWM_GSETTING setting); cb_uint32 cbTARGET_gGet(cbTARGET_Handle* hTarget, cbWM_GSETTING setting);
/** /**
* Set general tuning parameter. * Set general tuning parameter.
* *
* @param hTarget Handle to the current driver instance. * @param hTarget Handle to the current driver instance.
* @param setting setting to modify. * @param setting setting to modify.
* @param value value to set. * @param value value to set.
*/ */
void cbTARGET_gSet(cbTARGET_Handle* hTarget, cbWM_GSETTING setting, cb_uint32 value); void cbTARGET_gSet(cbTARGET_Handle* hTarget, cbWM_GSETTING setting, cb_uint32 value);
/** /**
* Get target specific tuning parameter. * Get target specific tuning parameter.
* *
* @param hTarget Handle to the current driver instance. * @param hTarget Handle to the current driver instance.
* @param setting setting to read. * @param setting setting to read.
* @return parameter value * @return parameter value
*/ */
cb_uint32 cbTARGET_tGet(cbTARGET_Handle* hTarget, cbWM_TSETTING setting); cb_uint32 cbTARGET_tGet(cbTARGET_Handle* hTarget, cbWM_TSETTING setting);
/** /**
* Set target specific tuning parameter. * Set target specific tuning parameter.
* *
* @param hTarget Handle to the current driver instance. * @param hTarget Handle to the current driver instance.
* @param setting setting to modify. * @param setting setting to modify.
* @param value value to set. * @param value value to set.
*/ */
void cbTARGET_tSet(cbTARGET_Handle* hTarget, cbWM_TSETTING setting, cb_uint32 value); void cbTARGET_tSet(cbTARGET_Handle* hTarget, cbWM_TSETTING setting, cb_uint32 value);
struct cb_wlan_configuration* cbTARGET_configuration_create(); struct cb_wlan_configuration* cbTARGET_configuration_create();
cbRTSL_Status cbTARGET_configure(cbTARGET_Handle* hTarget, cbTARGET_ConfigParams parameter, void* value); cbRTSL_Status cbTARGET_configure(cbTARGET_Handle* hTarget, cbTARGET_ConfigParams parameter, void* value);
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* Constants * Constants
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/

View File

@ -345,10 +345,10 @@ typedef cb_uint8 cbWLAN_MACAddress[6];
typedef cb_uint32 cbWLAN_RateMask; typedef cb_uint32 cbWLAN_RateMask;
/** /**
* Transmission power * Transmission power
* *
* @ingroup wlantypes * @ingroup wlantypes
*/ */
typedef cb_uint8 cbWLAN_TxPower; typedef cb_uint8 cbWLAN_TxPower;
/** /**
@ -423,11 +423,12 @@ cb_PACKED_STRUCT_BEGIN(cbWLAN_TimeOutInformation){
cb_uint8 timeOutType; cb_uint8 timeOutType;
cb_uint32 value; cb_uint32 value;
} cb_PACKED_STRUCT_END(cbWLAN_TimeOutInformation); } cb_PACKED_STRUCT_END(cbWLAN_TimeOutInformation);
/** /**
* Description of the Mobility Domain Information Element * Description of the Mobility Domain Information Element
* *
* @ingroup wlantypes * @ingroup wlantypes
*/ */
cb_PACKED_STRUCT_BEGIN(cbWLAN_FtInformation){ cb_PACKED_STRUCT_BEGIN(cbWLAN_FtInformation){
cb_uint8 eId; cb_uint8 eId;
@ -528,11 +529,11 @@ typedef struct cbWLAN_WepKey_s {
} cbWLAN_WEPKey; } cbWLAN_WEPKey;
/** /**
* Describes host revisions. * Describes host revisions.
* @see cbWM_Version * @see cbWM_Version
* *
* @ingroup types * @ingroup types
*/ */
typedef struct { typedef struct {
struct { struct {
cb_uint32 major; cb_uint32 major;
@ -545,11 +546,11 @@ typedef struct {
} cbWM_DriverRevision; } cbWM_DriverRevision;
/** /**
* Describes firmware revisions. * Describes firmware revisions.
* @see cbWM_Version * @see cbWM_Version
* *
* @ingroup types * @ingroup types
*/ */
typedef struct { typedef struct {
struct { struct {
cb_uint32 major; cb_uint32 major;
@ -563,22 +564,22 @@ typedef struct {
} cbWM_FWRevision; } cbWM_FWRevision;
/** /**
* Describes firmware revisions. Is divided into three parts; one for the * Describes firmware revisions. Is divided into three parts; one for the
* host driver side, one for target firmware, and one information string * host driver side, one for target firmware, and one information string
* descibing the HW manufacturer. * descibing the HW manufacturer.
* *
* @ingroup types * @ingroup types
*/ */
typedef struct version_st{ typedef struct version_st{
cbWM_DriverRevision host; cbWM_DriverRevision host;
cbWM_FWRevision target; cbWM_FWRevision target;
} cbWM_Version; } cbWM_Version;
/** /**
* Describes power levels for dynamic power level control. * Describes power levels for dynamic power level control.
* *
* @ingroup types * @ingroup types
*/ */
typedef struct cbWM_TxPowerSettings_s { typedef struct cbWM_TxPowerSettings_s {
cbWLAN_TxPower lowTxPowerLevel; cbWLAN_TxPower lowTxPowerLevel;
cbWLAN_TxPower medTxPowerLevel; cbWLAN_TxPower medTxPowerLevel;
@ -586,10 +587,10 @@ typedef struct cbWM_TxPowerSettings_s {
} cbWM_TxPowerSettings; } cbWM_TxPowerSettings;
/** /**
* Describes the startup settings needed to boot properly. * Describes the startup settings needed to boot properly.
* *
* @ingroup types * @ingroup types
*/ */
typedef struct cbWM_BootParameters_s { typedef struct cbWM_BootParameters_s {
cbWM_TxPowerSettings txPowerSettings; cbWM_TxPowerSettings txPowerSettings;
cb_uint8 primaryAntenna; cb_uint8 primaryAntenna;
@ -597,10 +598,10 @@ typedef struct cbWM_BootParameters_s {
} cbWM_BootParameters; } cbWM_BootParameters;
/** /**
* Describes an access point. * Describes an access point.
* *
* @ingroup types * @ingroup types
*/ */
typedef struct cbWLAN_ApInformation { typedef struct cbWLAN_ApInformation {
cbWLAN_Ssid ssid; /**< SSID */ cbWLAN_Ssid ssid; /**< SSID */
cbWLAN_MACAddress bssid; /**< BSSID */ cbWLAN_MACAddress bssid; /**< BSSID */
@ -608,10 +609,10 @@ typedef struct cbWLAN_ApInformation {
} cbWLAN_ApInformation; } cbWLAN_ApInformation;
/** /**
* Describes a station connected to an access point. * Describes a station connected to an access point.
* *
* @ingroup types * @ingroup types
*/ */
typedef struct cbWLAN_ApStaInformation { typedef struct cbWLAN_ApStaInformation {
cbWLAN_MACAddress MAC; cbWLAN_MACAddress MAC;
} cbWLAN_ApStaInformation; } cbWLAN_ApStaInformation;
@ -619,7 +620,7 @@ typedef struct cbWLAN_ApStaInformation {
typedef struct cbWLAN_HTCapabilities_st { typedef struct cbWLAN_HTCapabilities_st {
cbWLAN_RateMask rates; cbWLAN_RateMask rates;
cb_uint16 info; cb_uint16 info;
}cbWLAN_HTCapabilities; } cbWLAN_HTCapabilities;
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
* VARIABLE DECLARATIONS * VARIABLE DECLARATIONS
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
@ -654,11 +655,11 @@ extern const cb_uint8 PATTERN_WME_PE[3];
cbWLAN_Band cbWLAN_getBandFromChannel(cbWLAN_Channel channel); cbWLAN_Band cbWLAN_getBandFromChannel(cbWLAN_Channel channel);
/** /**
* Returns the valid rates @ref cbWLAN_RateMask based for the channel. * Returns the valid rates @ref cbWLAN_RateMask based for the channel.
* *
* @param channel The channel to be queried for rates. * @param channel The channel to be queried for rates.
* @return The valid rates @ref cbWLAN_RateMask for the requested channel. * @return The valid rates @ref cbWLAN_RateMask for the requested channel.
*/ */
cbWLAN_RateMask cbWLAN_getRatesForChannel(cbWLAN_Channel channel, cb_uint8 numberOfAntennas); cbWLAN_RateMask cbWLAN_getRatesForChannel(cbWLAN_Channel channel, cb_uint8 numberOfAntennas);
/** /**