Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*\
- |*|
- |*| Library of HM-10/11 AT commands
- |*|
- |*| Original source written 2020 by Trent M. Wyatt
- |*|
- |*| Based off of the datasheet: https://people.ece.cornell.edu/land/courses/ece4760/PIC32/uart/HM10/DSD%20TECH%20HM-10%20datasheet.pdf
- \*/
- //
- // Library of HM-10/11 AT commands
- //
- //
- // Note - I have version 5.51:
- //
- // >AT+VERS?
- // DSD TECH V551
- //
- // AT-Command support for all HM-10 commands
- //
- // Original source written 2020 by Trent M. Wyatt
- //
- #include <avr/pgmspace.h>
- #include <Arduino.h>
- #include "hm10.h"
- const char * const commands[] PROGMEM = {
- "AT",
- "AT+ADC[%X]?", // %X: 3,4,5,6,7,8,9,A,B map to PIO3~PIOB
- "AT+ADDR?",
- "AT+ADVI?",
- "AT+ADVI[%X]", // P1: 0 ~ F
- // 0: 100ms
- // 1: 152.5 ms
- // 2: 211.25 ms
- // 3: 318.75 ms
- // 4: 417.5 ms
- // 5: 546.25 ms
- // 6: 760 ms
- // 7: 852.5 ms
- // 8: 1022.5 ms
- // 9: 1285 ms
- // A: 2000ms
- // B: 3000ms
- // C: 4000ms
- // D: 5000ms
- // E: 6000ms
- // F: 7000ms
- // Default: 9
- // HMSoft Default: 0
- // HMSensor Default: 9
- "AT+ADTY?",
- "AT+ADTY[%X]", // %X: 0 ~ 3
- // 0: Advertising, ScanResponse, Connectable
- // 1: Only allow last device connect in 1.28 seconds
- // 2: Only allow Advertising and ScanResponse.
- // 3: Only allow Advertising
- // Default: 0
- "AT+ANCS?",
- "AT+ANCS[%X]", // P1: 0 ~ 1
- // 0: Off
- // 1: On
- // Default: 0
- //
- // Note1: This command added in V524.
- // Note2: Please send AT+RESET to restart module if you set value 1.
- // Note3: Must execute AT+TYPE3 first.
- "AT+ALLO?",
- "AT+ALLO[%X]", // P1: 0 ~ 1
- // 0: Off
- // 1: On
- // Default: 0
- // Note1: This command added in V523.
- // Note2: White List allows three MAC address link to module. Please use AT+AD
- // command set white list MAC address.
- "AT+AD[%X]??", // %X: 1, 2, 3
- "AT+ALLO[%X][%6X]",
- // %s: MAC address
- // %X default: 0
- "AT+BEFC?",
- "AT+BEFC[%03X]", // %X: 000 ~ 3FF
- // Default: 000
- // This command added in V527.
- // 3FF == 001111111111, left to right side is map to PIO0~PIOB, PIO0 and PIO1 are
- // used by system as pushbutton and system LED. Only Pio2~PIOB pins is available.
- // e.g. Set PIO2~PIOB all output high after power supplied.
- // Send: AT+BEFC3FF
- // Recv:OK+Set:3FF
- // When next time power on, module PIO2~PIOB will output high.
- // Note: Query PIO pins current state please use AT+PIO?? Command.
- // Note: Please don’t use this command when “AT+MODE1” is setup.
- "AT+AFTC?",
- "AT+AFTC[%03X]", // P1: 000~ 3FF
- // Default: 000
- // This command added in V527.
- // 3FF == 001111111111, Left to right side is map to PIO0~PIOB, PIO0 and PIO1 is
- // used by system. Only Pio2~PIOB pins is available.
- // e.g. Set PIO2~PIOB all output high when connection is established.
- // Send: AT+AFTC3FF
- // Recv: OK+Set:3FF
- // When Bluetooth connection is established, module PIO2~PIOB will output high.
- // Note: Query PIO pins current state please use “AT+PIO??” command.
- // Note: Please don’t use this command when “AT+MODE1” is setup.
- "AT+BATC?",
- "AT+BATC[%X]", // P1: 0 ~ 1
- // 0: Off
- // 1: On
- // Default: 0
- // This command added in V520
- "AT+BATT?", // Receive OK+BATT:[P1] - P1: 000 ~ 100
- // There are three ways to get battery information:
- // a. Before establishing a connection, Send “AT+BATT?” through UART.
- // b. After established a connection, In Mode 1 or 2, remote side send “AT+BATT?”
- // Battery information has included in scan response data package, one hour update
- // once. You can use Android or IOS discovery module, when module has been
- // discovered, you can get it from scan result array.
- // Data format is 0x02, 0x16, 0x00, 0xB0, [FLAG], [temperature], [ humidity], [battery].
- //
- // Android:
- // Included in OnLeScan function result array, you can see it direct.
- //
- // private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() {
- // @Override
- // public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) {
- // ......<Other code>......
- // String sBatt = ""; //Battery
- // String sTemp = ""; //Temperature
- // String sHumi = ""; //Humidity
- // for (int i = 0; i < scanRecord.length; i++) {
- // if (i + 7 < scanRecord.length) {
- // // Since V522
- // if (scanRecord[i] == 0x07 && scanRecord[i + 1] == 0x16 && scanRecord[I + 2] == 0x00 && scanRecord[I + 3] == 0xB0) {
- // if (scanRecord[i] == 0x02 && scanRecord[i + 1] == 0x16 && scanRecord[I + 2] == 0x00 && scanRecord[I + 3] == 0xB0) {
- // if (scanRecord[i + 7] > 0)
- // sBatt = String.valueOf(scanRecord[i + 7]);
- // if (scanRecord[i + 5] > 0)
- // sTemp = String.valueOf(scanRecord[i + 5]);
- // if (scanRecord[i + 6] > 0)
- // sHumi = String.valueOf(scanRecord[i + 6]);
- // }
- // }
- // }
- // ......<Other code>......
- // }
- // };
- //
- // iOS:
- // c. Included in LeScan function result NSDictionary struct, service id is 0xB000.
- "AT+BATT[%0x02]", // P1: 0x00 ~ 0xFF
- // Not include ‘?’
- // This command is used to set battery information byte in advertising data when you
- // doesn’t want to use battery function buy want to use as AT+FLAG command.
- "AT+BIT7?", // P1: bit7 switch.
- "AT+BIT7[%1X]", // 0 = Not compatible
- // 1 = Compatible
- // Default: 0
- // This command is used only for compatible uses 7 data bits, 2 stop bit device.
- "AT+BAUD?", // Baud rate #
- "AT+BAUD[%1X]", //
- // 0 = 9600
- // 1 = 19200
- // 2 = 38400
- // 3 = 57600
- // 4 = 115200
- // 5 = 4800
- // 6 = 2400
- // 7 = 1200
- // 8 = 230400
- // Default: 0 (9600)
- //
- // e.g.
- // Query baud:
- // Send: AT+BAUD?
- // Receive: OK+Get:0
- // Setup baud:
- // Send: AT+BAUD1
- // Receive: OK+Set:1
- // Note: If setup to Value 7, After next power on, module will not support any AT
- // Commands, until PIO0 is pressed, Module will change Baud to 9600.
- "AT+COMI?", // Receive: OK+Get:[P1]
- // P1: 0 ~ 9
- // Default: 3 (20 ms)
- "AT+COMI[%1X]", // 0 = 7.5 ms
- // 1 = 10.0 ms
- // 2 = 15.0 ms
- // 3 = 20.0 ms
- // 4 = 25.0 ms
- // 5 = 30.0 ms
- // 6 = 35.0 ms
- // 7 = 40.0 ms
- // 8 = 45.0 ms
- // 9 = 4000.0 ms
- // Note: This command is added since V538
- "AT+COMA?", // Receive: OK+Get:[P1]
- // P1: 0 ~ 9
- // Default: 7 (40 ms)
- "AT+COMA[%1X]", //
- // 0 = 7.5 ms
- // 1 = 10.0 ms
- // 2 = 15.0 ms
- // 3 = 20.0 ms
- // 4 = 25.0 ms
- // 5 = 30.0 ms
- // 6 = 35.0 ms
- // 7 = 40.0 ms
- // 8 = 45.0 ms
- // 9 = 4000.0 ms
- // Note: This command is added since V538
- "AT+COLA?", // Receive: OK+Get:[P1]
- // P1: 0 ~ 4
- // Default: 0
- "AT+COLA[P1]", //
- // Note: This command is added since V538
- "AT+COSU?", // Receive: OK+Get:[P1]
- // P1: 0 ~ 6
- // Default: 6 (6000 ms)
- // 0 = 100.0 ms
- // 1 = 1000.0 ms
- // 2 = 2000.0 ms
- // 3 = 3000.0 ms
- // 4 = 4000.0 ms
- // 5 = 5000.0 ms
- // 6 = 6000.0 ms
- // Note: This command is added since V538
- "AT+COUP?", // Receive: OK+Get:[P1]
- // P1: 0 ~ 1
- // 0 = Don’t update
- // 1 = Update
- // Default: 1 (update)
- // This command is only use when module is in slave role.
- // Note: This command is added since V538
- "AT+CHAR?", // Receive: OK+Get:[P1]
- // P1: 0x0001~0xFFFE
- "AT+CHAR[P1]", // Default: 0xFFE1
- // e.g. change characteristic value to 0xAAA0
- // Send: AT+CHAR0xAAA0
- // Recv: OK+Set:0xAAA0
- "AT+CLEAR", // Notice: Only Central role is used.
- "AT+CONNL", // Receive: OK+CONN[P1]
- // P1: L, E, F, N
- // L: Connecting
- // E: Connect error
- // F: Connect Fail
- // N: No Address
- // Notice: Only Central role is used. Must set up AT+IMME1 and AT+ROLE1 first.
- // If remote device has already connected to other device or shut down,
- // “OK+CONNF” will received after about 10 seconds.
- "AT+CO[P0][P1]", // Receive: OK+CO[P0][P0][P2]
- // P0: N, 0, 1, 2
- // N: Normal Address
- // 0: Static MAC
- // 1: Static random MAC
- // 2: Random MAC
- // P1: Address (like: 0017EA090909)
- // P2: A, E, F
- // A: Connecting
- // E: Connect error
- // F: Connect Fail
- //
- // Notice: Only central role is used. Must set up AT+IMME1 and AT+ROLE1 first.
- // If remote device has already connected to other device or shut down,
- // “OK+CONNF” will received after about 10 Seconds.
- // e.g.
- // Try to connect an device which MAC address is 00:17:EA:09:09:09
- // Send: AT+CON0017EA090909
- // May receive a reply:
- // OK+CONNA ========= Accept request, connecting
- // OK+CONNE ========= Connect error
- // OK+CONN ========= Connected, if AT+NOTI1 is setup
- // OK+CONNF ========= Connect Failed, After 10 seconds
- // Note: O is not zero
- "AT+CONN[P1]", // Receive: OK+CONN[P2]
- // P1: 0~5
- // P2: E, F, 0~5
- // E: Link error
- // F: Link failed
- // 0~5: Try to connect
- // This command is used after executing: AT+DISC?
- // When AT+DISC? Command return first device use P1 as 0, then second device
- // use P1 as 1, third device use P1 as 2.
- // This command will clear all discovery data.
- "AT+COL??", // Receive: P1: 0x00~0xFF
- // P1 is a byte, has 8 bits, bit 7 ~ bit 0 is map to the PIO4 ~ PIO11.
- // This command is added since V515 version.
- "AT+CYC??", // Receive: OK+ Get:[P1]
- // P1: 00 ~ 99
- // Unit: seconds
- // Default: 10
- "AT+CYC[P1]", // Receive: OK+ Set:[P1]
- // In mode 1, when PIO state is change, module will send OK+Col:[xx] to UART or
- // remote side. This command is set send interval.
- // This command is added since V515 version.
- "AT+COMP?", // Receive: OK+ Get:[P1]
- // P1: 0, 1, ?
- // 0: Off
- // 1: On
- // ?: Query
- // Default: 0
- "AT+COMP[P1]", // Receive: OK+ Set:[P1]
- // Please reference <How_To_Use_HM-1x_Study_function.pdf>
- // This command is added since V542 version.
- "AT+DISC?", // Recieve: OK+DIS[P0][P1]
- // P0: C, 0, 1, 2
- // C: Common string
- // 0~2: Address type
- // P1: S, E, [MAC String]
- // S: Start discovery
- // E: End discovery
- // MAC String: Device MAC string
- // Please set AT+ROLE1 and AT+IMME1 first.
- // e.g.
- // Send: AT+DISC?
- // Recv: OK+DISCS
- // Recv: OK+DIS[P0]:123456789012 (discovered device address information)
- // If AT+SHOW1 is setup, you will receive then Name information as follow
- // Recv: OK+NAME: xxx
- // After send Name value, will send two extra “\r\n” value ASCII byte
- // If AT+SHOW2 is setup, you will receive then RSSI information as follow
- // Recv: OK+RSSI: xxx\r\n
- // If AT+SHOW3 is setup, you will receive then RSSI information and Name information
- // Recv: OK+DIS[P0]:234567890123
- // Recv: OK+NAME: xxx
- // After send Name value, will send two extra “\r\n” value ASCII byte
- // …..(Before V535 max results is 6, Since V535 not limit)
- // Recv: OK+DISCE
- // Connect use array index:
- // Connect to a discovered device: AT+CONN0, AT+CONN1……AT+CONN5
- // Connect use MAC string: AT+CON[MAC String]
- "AT+DISI?", // Receive: OK+DISC[P0:P1:P2:P3:P4]
- // P0: Factory ID
- // P1: iBeacon UUID
- // P2: Major Value
- // Minor Value
- // Measured Power
- // P3: MAC
- // P4: RSSI
- //
- // Please set AT+ROLE1 and AT+IMME1 first.
- // e.g.
- // Send: AT+DISI?
- // Recv: OK+DISCS (Scan start)
- // Recv: OK+DIS[P0:P1:P2:P3:P4] (if have one device)
- // Recv: OK+DIS[P0:P1:P2:P3] (if have two devices)
- // ........
- // Recv: OK+DISCE (Scan end)
- // P0 length is 8; P1 length is 32; P2 length is 10; P3 length is 12, P4 length is 4
- // P2 include Major Value (length 4);
- // Minor Value (length 4);
- // Measured Power (length 2)
- // If the device not enable iBeacon function, P0, P1, P2 will use ‘0’ fill.
- // Note: Added since V539
- "AT+DISA?", // Recieve:
- // OK+DISAS -> Start scan
- // OK+DISC[P0:P1:P2:P3:P4]
- // OK+DISAE -> Scan finished
- //
- // P0: Device MAC (6Byte)
- // P1: Device Type(1Byte)
- // P2: Device RSSI(1Byte)
- // P3: Rest Data Length
- // (1Byte)
- // P4: Rest Data
- //
- // Please set AT+IMME1 and AT+ROLE1 first.
- // Note: All data is in Hex format.
- // Added in V547
- "AT+DELO[P1]", // Receive: OK+DELO[P1]
- // P1: 1, 2
- // 1: Allowed to broadcast and scanning
- // 2: Only allow broadcast
- //
- // After receive OK+DELO[P1], module will reset after 500ms.
- // This command will let module into non-connectable status until next power on.
- "AT+ERASE", // Recieve: OK+ERASE
- // Note: Added in V524 version.
- "AT+FFE2[P1]", // Receive: OK+ Set:[P1]
- // P1: ?, 0, 1, 2
- // ?: Query
- // 0: Only use one Characteristic
- // 2: Use two Characteristic
- // Second Char value = first Char value + 1
- // 3: Use two Characteristic
- // Second Char value = first Char value - 1
- // Note: This command added since V550.
- "AT+FLAG[P1]", // Receive: OK+ Set:[P1]
- // P1: 0~FF (one byte)
- // Note: This command added in V530. Please ref to AT+BATT? Command.
- "AT+FIOW?", // Receive: OK+ Get:[P1]
- // P1: 0, 1
- // 0: Off
- // 1: On
- // Default: 0
- "AT+FIOW[P1]", // Receive: OK+ Set:[P1]
- "AT+GAIN?", // Receive: OK+ Get:[P1]
- // P1: 0, 1
- // 0: No RX gain
- // 1: Open RX gain
- // Default: 0
- "AT+GAIN[P1]", // Receive: OK+ Set:[P1]
- // Note: This command is added since V535
- "AT+HELP?", // Receive: Help Information
- "AT+HUMI[P1]", // Receive: OK+Set:[P1]
- // P1: 0x00~0xFF
- // This command is used to set humi information byte in advertising data when you
- // doesn’t want to use humi function but want to use as AT+FLAG command.
- // Note: Added in V544
- "iAT+IMME?", // Receive: OK+ Get:[P1]
- // P1: 0, 1
- // 1: When module is powered on,
- // only respond the AT Command,
- // don’t do anything. Until AT +
- // START, AT+CON, AT+CONNL
- // commands is received.
- // 0: When power on, module will
- // start work immediately
- // Default: 0
- "AT+IMME[P1]", // Receive: OK+ Set:[P1]
- // This command is only used for Central role.
- "AT+IBEA?", // Receive: OK+Get:[P1]
- // P1: 0, 1
- // 0: Turn off iBeacon
- // 1: Turn on iBeacon
- // Default: 0
- "AT+IBEA[P1]", // Receive: OK+Set:[P1]
- // iBeacon UUID is: 74278BDA-B644-4520-8F0C-720EAF059935.
- // This command is added since V517 version.
- "AT+IBE0?", // Receive: OK+Get:[P1]
- // P1: 00000001~FFFFFFFE
- // Default: 74278BDA
- //
- "AT+IBE0[P1]", // Receive: OK+Set:[P1]
- // iBeacon UUID is: 74278BDA-B644-4520-8F0C-720EAF059935.
- // ^^^^^^^^ (colored in red in response)
- // This command can change red color string in iBeacon UUID.
- // This command is added since V520 version.
- // e.g.: Send: AT+IBE012345678 change iBeacon UUID red color string to
- // “12345678”
- "AT+IBE1?", // Receive: OK+Get:[P1]
- // P1: 00000001~FFFFFFFE
- // Default: B6444520
- "AT+IBE1[P1]", // Receive: OK+Set:[P1]
- //
- // iBeacon UUID is: 74278BDA-B644-4520-8F0C-720EAF059935.
- // ^^^^ ^^^^ (colored in red in response)
- // This command can change red color string in iBeacon UUID.
- // This command is added since V520 version.
- // e.g.: Send: AT+IBE112345678 change iBeacon UUID red color string to
- // “12345678”
- "AT+IBE2?", // Receive: OK+Get:[P1]
- // P1: 00000001~FFFFFFFE
- // Default: 8F0C720E
- "AT+IBE2[P1]", // Receive: OK+Set:[P1]
- //
- // iBeacon UUID is: 74278BDA-B644-4520-8F0C-720EAF059935.
- // ^^^^ ^^^^ (colored in red in response)
- // This command can change red color string in iBeacon UUID.
- // This command is added since V520 version.
- // e.g.: Send: AT+IBE112345678 change iBeacon UUID red color string to
- // “12345678”
- "AT+IBE3?", // Receive: OK+Get:[P1]
- // P1: 00000001~FFFFFFFE
- // Default: AF059935
- "AT+IBE3[P1]", // Receive: OK+Set:[P1]
- // iBeacon UUID is: 74278BDA-B644-4520-8F0C-720EAF059935.
- // ^^^^^^^^ (colored in red in response)
- // This command can change red color string in iBeacon UUID.
- // This command is added since V520 version.
- // e.g.: Send: AT+IBE112345678 change iBeacon UUID red color string to
- // “12345678”
- "AT+MARJ?", // Receive: OK+Get:[P1]
- // P1: 0x0001, 0xFFFE
- // Default: 0xFFE0
- //
- "AT+MARJ[P1]", // Receive: OK+Set:[P1]
- //
- // e.g. Change marjor version to 0x0102
- // Send: AT+MARJ0x0102, if all is okay, module will send back OK+Set: 0x0102
- // This command is added since V517 version.
- "AT+MINO?", // Receive: OK+Get:[P1]
- // P1: 0x0001, 0xFFFE
- // Default: 0xFFE1
- "AT+MINO[P1]", // Receive: OK+Set:[P1]
- // This command is added since V517 version.
- "AT+MEAS?", // Receive: OK+Get:[P1]
- // P1: 0x01~ 0xFF
- // Default: 0xC5
- "AT+MEAS[P1]", // OK+Set:[P1]
- // This command is added since V519 version.
- "AT+MODE?", // Receive: OK+Get:[P1]
- // P1: 0, 1, 2
- // 0: Transmission Mode
- // 1: PIO collection Mode + Mode 0
- // 2: Remote Control Mode + Mode 0
- // Default: 0
- "AT+MODE[P1]", // Receive: OK+Set:[P1]
- //
- // Mode 0:
- // Before establishing a connection, you can use the AT command configuration
- // module through UART.
- // After established a connection, you can send data to remote side from each
- // other.
- // Mode 1:
- // Before establishing a connection, you can use the AT command configuration
- // module through UART.
- // After established a connection, you can send data to remote side. Remote side
- // can do fellows:
- // Send AT command configuration module.
- // Collect PIO04 to the PIO11 pins input state of HM-10.
- // Collect PIO03 pins input state of HM-11.
- // Remote control PIO2, PIO3 pins output state of HM-10.
- // Remote control PIO2 pin output state of HM-11.
- // Send data to module UART port (not include any AT command and per package
- // must less than 20 bytes).
- // Mode 2:
- // Before establishing a connection, you can use the AT command configuration
- // module through UART.
- // After established a connection, you can send data to remote side. Remote side
- // can do fellows:
- // Send AT command configuration module.
- // Remote control PIO2 to PIO11 pins output state of HM-10.
- // Remote control PIO2, PIO3 pins output state of HM-11.
- // Send data to module UART port (not include any AT command and per package
- // must less than 20 bytes).
- "AT+NOTI?", // Receive: OK+Get:[P1]
- // P1: 0, 1
- // 0: Don’t Notify
- // 1: Notify
- // Default: 0
- "AT+NOTI[P1]", // Receive: OK+Set:[P1]
- //
- // If this value is set to 1, when link ESTABLISHED or LOSTED module will send
- // OK+CONN or OK+LOST string through UART.
- "AT+NOTP?", // Receive: OK+ Get[P1]
- // P1: 0, 1; default: 0
- // 0: without address
- // 1: with address
- "AT+NOTP[P1]", // Receive: OK+ Set[P1]
- //
- // This command must work with “AT+NOTI1”, if this switch is open, when the
- // module connect to disconnect, the prompt string will include the remote address.
- // OK+CONN:001122334455 String “001122334455” is the MAC address string
- // Added since V534.
- "AT+NAME", // Receive: OK+NAME[P1]
- // P1: module name, Max length is 12.
- // Default: HMSoft
- "AT+NAME[P1]", // Receive: OK+SetName[P1]
- //
- // e.g.
- // change module name to bill_gates
- // Send: AT+NAMEbill_gates
- // Receive: OK+SetName:bill_gates
- "AT+PCTL?", // Receive: OK+Get:[P1]
- // P1: 0,1
- // 0:Normal power output
- // 1:Max power output
- // Default: 1
- "AT+PCTL[P1]", // Receive: OK+Set:[P1]
- // Noted: Added in V527
- "AT+PARI?", // Receive: OK+Get:[P1]
- // P1: 0,1,2
- // 0:None
- // 1:EVEN
- // 2:ODD
- // Default: 0 (None)
- "AT+PARI[P1]", // Receive: OK+Set:[P1]
- "AT+PIO1?", // Receive: OK+Get:[P1]
- // P1: 0, 1
- // 0: Unconnected Output
- // 500ms High 500ms Low,
- // Connected output High.
- // 1: Unconnected output Low,
- // Connected output High.
- // Default: 0
- "AT+PIO1[P1]", // Receive: OK+Set:[P1]
- "AT+PIO[P1]?", // Receive: OK+PIO:[P1][P2]
- // P1: 2~B, ?
- // P2: 0, 1, ?
- // HM-11 only has 4 pins.
- // P1 is which PIO pin you want to Query/Set
- // Value: 2,3,4,5,6,7,8,9,A,B.
- // P2 is Query or setup value.
- // “0” is low and “1” is high and
- // “?” is query
- "AT+PIO[P1][P2]", // Receive: OK+PIO:[P1][P2]
- //
- // e.g.
- // Query PIO2
- // Send: AT+PIO2?
- // Setup PIO2 output high
- // Send: AT+PIO21
- // Receive: OK+PIO21
- // HM-10 HMSensor version: P1 value is 2~A
- // HM-10 HMSoft version: P1 value is 2~B
- // HM-11 HMSensor version: P1 value is 2
- // HM-11 HMSoft version: P1 value is 2, 3
- // V525 added PIO2 PWM function, P2 value is 0~9
- // 0: output low
- // 1: output high
- // 2: output 100ms PWM
- // 3: output 200ms PWM
- // ....
- // 9: output 800ms PWM
- // V527 added AT+PIO?? Format query all pins output state.
- "AT+PASS?", // Receive: OK+Get:[P1]
- // P1 is Pin Code,
- // 000000~999999
- // Default: 000000
- "AT+PIN[P1]", // Receive: OK+Set:[P1]
- //
- // e.g.
- // Query Pin Code
- // Send: AT+PIN?
- // Receive: OK+PIN:000000
- // Setup Pin Code 008888
- // Send: AT+PIN008888
- // Receive: OK+Set:008888
- "AT+POWE?", // Receive: OK+Get:[P1]
- // P1: 0 ~ 3
- // 0: -23dbm
- // 1: -6dbm
- // 2: 0dbm
- // 3: 6dbm
- // Default: 2
- "AT+POWE[P1]", // OK+Set:[P1]
- "AT+PWRM?", // Receive: OK+Get:[P1]
- // P1: 0~1
- // 0:Auto sleep
- // 1:don’t auto sleep
- // Default: 1
- "AT+PWRM[P1]", // Receive: OK+Set:[P1]
- // Only support peripheral role.
- "AT+RELI?", // Receive: OK+Get:[P1]
- // P1: 0, 1
- // 0: Normal advertising
- // 1: Reliable advertising
- // Default: 0
- "AT+RELI[P1]", // receive: OK+Set:[P1]
- // Note: This command is added since V530
- "AT+RENEW", // Receive: AT+RENEW
- "AT+RESET", // Receive: OK+RESET
- };
Advertisement
Comments
-
- Based off of the datasheet: https://people.ece.cornell.edu/land/courses/ece4760/PIC32/uart/HM10/DSD%20TECH%20HM-10%20datasheet.pdf
Add Comment
Please, Sign In to add comment
Advertisement