ble

Source:

Methods

(static) analyzePacketBle(message_buffer) → {string}

Description:
  • Generic Analysing Encoded Received BLE Packet Function
Source:
Parameters:
Name Type Description
message_buffer ArrayBuffer | string Encoded Message Buffer
Returns:
Type
string

(static) createPacketBle(cmd, message, class_message) → {Uint8Array}

Description:
  • Generic Create Encoded Bluetooth Packet Function
Source:
Parameters:
Name Type Description
cmd number
message Object
class_message Object
Returns:
Type
Uint8Array

(static) decodePacketBle(buffer, classDecode) → {Object}

Description:
  • Execute Decoding Received Bluetooth Packet from the Dwarf II
Source:
Parameters:
Name Type Description
buffer Uint8Array
classDecode Object Class of Message depending on the command
Returns:
Type
Object

(static) messageGetSystemInfo() → {Uint8Array}

Description:
  • 3.6 Obtain device information Create Encoded Packet for the command Get device information CMD instruction, value is 7
Source:
Returns:
Type
Uint8Array

(static) messageGetWifiList() → {Uint8Array}

Description:
  • 3.5 Get WiFi list Create Encoded Packet for the command Get WiFi list CMD instruction, value is 6
Source:
Returns:
Type
Uint8Array

(static) messageGetconfig(ble_psd) → {Uint8Array}

Description:
  • 3.1.1 Request data Create Encoded Packet for the command Getconfig CMD instruction, value is 1
Source:
Parameters:
Name Type Description
ble_psd string ; //Default: "DWARF_12345678"
Returns:
Type
Uint8Array

(static) messageResetWifi() → {Uint8Array}

Description:
  • 3.4 Reset Bluetooth WiFi Create Encoded Packet for the command Reset Bluetooth WiFi CMD instruction, value is 5
Source:
Returns:
Type
Uint8Array

(static) messageWifiAP(wifi_type, auto_start, country_list, country, ble_psd) → {Uint8Array}

Description:
  • 3.2 Configure WiFi AP mode Create Encoded Packet for the command Configure WiFi AP mode CMD instruction, value is 2
Source:
Parameters:
Name Type Description
wifi_type Number ; // 0-5G 1-2.4G
auto_start Number ; // WiFi boot configuration 0 - boot not start 1 - boot start
country_list Number ; // 0- do not configure country_list 1- configure country_list
country string ; //
ble_psd string ; //Default: "DWARF_12345678"
Returns:
Type
Uint8Array

(static) messageWifiSTA(auto_start, ble_psd, ssid, psd) → {Uint8Array}

Description:
  • 3.3 Configure WiFi STA mode Create Encoded Packet for the command Configure WiFi AP mode CMD instruction, value is 2
Source:
Parameters:
Name Type Description
auto_start Number ; // WiFi boot configuration 0 - boot not start 1 - boot start
ble_psd string ; // Default: "DWARF_12345678"
ssid string ; // WiFi name of router to connect
psd string ; // WiFi password of the router to be connected
Returns:
Type
Uint8Array

(inner) calculateCRC16(buffer) → {number}

Description:
  • Calculates the buffers crc16.
Source:
Parameters:
Name Type Description
buffer any the data buffer.
Returns:
the calculated crc16. Source: github.com/yaacov/node-modbus-serial
Type
number

(inner) getArrayFromHexString(data) → {array}

Description:
  • GetArrayFromHexString
Source:
Parameters:
Name Type Description
data string
Returns:
Type
array

(inner) getDecimalToHex16bString(number) → {string}

Description:
  • getDecimalToHexString
Source:
Parameters:
Name Type Description
number number
Returns:
Type
string