ESPMesh is an App that integrates bluetooth distribution network and wi-fi control, The App is available in the App Store. The main functions of ESPMesh are as follows:
- Wi-fi network configuration function based on bluetooth channel
- Send control commands over a wi-fi network
- OTA upgrades for remote and local devices
- UDP and mDNS scanning
- Enable bluetooth scan
- Turn off bluetooth scan
- Get bluetooth status
- Bluetooth connection
- Send custom data
- Device negotiation encryption
- Notifies the device to enter encryption mode
- Bluetooth config network
- Bluetooth disconnection
- Enable UDP scanning
- Send multiple device commands
- Device upgrades
- Stop OTA upgrade
- Restart device command
/**
Enable bluetooth scan
@param success Bluetooth scan successful callback
@param failure Callback for failed bluetooth scan
*/
- (void)startBleScanSuccess:(BleScanSuccessBlock)success andFailure:(void(^)(int fail))failure;
/**
Turn off bluetooth scan
*/
- (void)stopBleScan;
// Get bluetooth status, Implement the following proxy method via <BleDelegate>
- (void)bleUpdateStatusBlock:(CBCentralManager *)central;
/**
Bluetooth connection
@param deviceInfo Bluetooth connection parameters
@param success Bluetooth connection successful callback
@param failure Bluetooth connection failed callback
*/
+ (void)BleConnection:(NSDictionary *)deviceInfo andSuccess:(void(^)(NSDictionary *dic))success andFailure:(void(^)(NSDictionary *dic))failure;
/**
Send custom data
@param dataMessage Custom data that needs to be sent
*/
- (void)sendMDFCustomDataToDevice:(NSData *)dataMessage;
/**
Device negotiation encryption
*/
- (void)sendDevicesNegotiatesEncryption;
/**
Notifies the device to enter encryption mode
*/
- (void)notifyDevicesToEnterEncryptionMode;
/**
Bluetooth config network
messageDic = @{
@"ssid":@"",
@"password":@"",
@"ble_addr":@""
}
@param messageDic Bluetooth config network information
@param success Successful callback of bluetooth config network
@param failure failed callback of bluetooth config network
*/
- (void)startConfigureBlufi:(NSDictionary *)messageDic andSuccess:(void(^)(NSDictionary *dic))success andFailure:(void(^)(NSDictionary *dic))failure;
/**
Bluetooth disconnection
*/
- (void)stopConfigureBlufi;
/**
Enable UDP scanning
@param success UDP scans successful callbacks, There are two scenarios for callbacks: 1. Gets device basic information onDeviceScanning, 2. Get device details DevicesOfScanUDP.
@param failure UDP scan failed callback, fail is 8010 ande 8011,8010 contains (allArray Incorrect format、getMeshInfoFromHost Network request failed、Device basic information tempInfosArr is empty), 8011 failed to load local storage data for device details query.
*/
+ (void)scanDevicesAsyncSuccess:(DevicesAsyncSuccessBlock)success andFailure:(void(^)(int fail))failure;
/**
Send multiple device commands
messageDic = @{
@"request":@"",
@"callback":@"",
@"tag":@"",
@"mac":@"",
@"host":@"",
@"root_response":@"",
@"isSendQueue":@""
}
@param messageDic Send device command information
@param success Successful callback to send device command
@param failure Failed callback to send device command
*/
+ (void)requestDevicesMulticastAsync:(NSDictionary *)messageDic andSuccess:(void(^)(NSDictionary *dic))success andFailure:(void(^)(NSDictionary *failureDic))failure;
12. Device upgrades
/**
Device upgrades
messageDic = @{
@"macs":@"",
@"bin":@"",
@"host":@"",
@"type":@""
}
@param messageDic Information about equipment upgrades
@param success Callback for successful device upgrade
@param failure callback for a failed device upgrade
*/
- (void)startOTA:(NSDictionary *)messageDic Success:(startOTASuccessBlock)success andFailure:(void(^)(int fail))failure;
13. Stop OTA upgrade
/**
Stop OTA upgrade
messageDic = @{
@"host":@[]
}
@param messageDic Stop OTA upgrade information
*/
- (void)stopOTA:(NSDictionary *)messageDic;
/**
Restart device command
messageDic = @{
@"macs":@[]
}
@param messageDic Restart device command information
*/
- (void)reboot:(NSDictionary *)messageDic;