Cypress Bluetooth Mesh Gateway
cypress::embedded::Mesh Class Reference

Description

Defines Bluetooth Mesh class - targetting only Cypress' embedded Bluetooth stack.

Public Types

enum  BluetoothMeshProvisioningStatus {
  BLUETOOTH_MESH_DEVICE_UNPROVISIONED,
  BLUETOOTH_MESH_DEVICE_PROVISIONED
}
 Defines Bluetooth Mesh Provisioning status values. More...
 
enum  BluetoothMeshConnectionStatus {
  BLUETOOTH_MESH_NETWORK_CONNECTED,
  BLUETOOTH_MESH_NETWORK_DISCONNECTED
}
 Defines Bluetooth Mesh Connection status values. More...
 
enum  BluetoothMeshEvent {
  BLUETOOTH_MESH_DEVICE_PROVISIONING_STATUS,
  BLUETOOTH_MESH_DEVICE_STATUS,
  BLUETOOTH_MESH_NETWORK_RECEIVED_DATA,
  BLUETOOTH_MESH_NETWORK_STATUS,
  BLUETOOTH_MESH_NVRAM_DATA
}
 Defines Bluetooth Mesh Event values. More...
 
typedef void(* MeshEventCallback_t) (BluetoothMeshEvent event, MeshEventCallbackData *payload)
 Defines Embedded BLE Mesh EVent callback Function.
 

Public Member Functions

ble_error_t initialize (void)
 Starts the Mesh Application on Bluetooth Controller and Wiced HCI serveice on Host.
 
ble_error_t shutdown (void)
 Stops Mesh Application on Bluetooth Controller and Wiced HCI service on Host.
 
ble_error_t connectMesh ()
 Connect to nearby Mesh Network(connects to the mesh network depending on Network-key the device was Provisioned with)
 
ble_error_t disconnectMesh ()
 Disconnect from Mesh Network.
 
ble_error_t pushNVData (uint8_t *data_in, uint8_t data_len, uint16_t idx)
 Push saved NVRAM data to Bluetooth Controller. More...
 
int sendData (uint8_t *p_data, uint8_t data_len)
 Downstream the packet received from Cloud to Mesh Network.
 
BluetoothMeshProvisioningStatus getProvisionedState (void)
 Getter for Device's Provisioning state.
 
BluetoothMeshConnectionStatus getConnectionState (void)
 Getter for Connection state of the Device - Connected to Mesh network or not.
 
ble_error_t registerMeshEventcallback (MeshEventCallback_t cb)
 Register Mesh Event Callback - TODO: Try using Mbed-callback Class for this.
 
MeshEventCallback_t getmeshCallback (void)
 Returns Mesh Event callback registered with the Mesh Object.
 

Static Public Member Functions

static MeshgetMeshInstance (BLE &ble)
 Get Mesh Instance.
 

Member Function Documentation

◆ pushNVData()

ble_error_t cypress::embedded::Mesh::pushNVData ( uint8_t *  data_in,
uint8_t  data_len,
uint16_t  idx 
)

Push saved NVRAM data to Bluetooth Controller.

For example - saved pairing keys, mesh-provisioning data, saved name, address etc.