Documentation ¶
Overview ¶
Package anna_b112 supports serial communication and reprogramming for the u-blox ANNA-B112 Bluetooth (BLE) module.
Index ¶
- Variables
- func ATSetInternalRCLFCK() (err error)
- func Backup() (flashPath string, uicrPath string, err error)
- func Disable() (err error)
- func Enable() (err error)
- func EnterBootloaderMode() (err error)
- func EnterNormalMode() (err error)
- func Flash(flashPath string, uicrPath string) (err error)
- func FlashSetInternalRCLFCK() (err error)
- func GetDeviceManufacturer() (manufacturer string, err error)
- func GetDeviceModel() (model string, err error)
- func GetDeviceName() (name string, err error)
- func GetDeviceSerial() (model string, err error)
- func GetSoftwareVersion() (version string, err error)
- func Info() (id string, err error)
- func Reset() (err error)
- func SetDeviceName(name string) (err error)
- func Update(updateFile string) (err error)
Constants ¶
This section is empty.
Variables ¶
var ( // Serial device path UARTPath = "/dev/ttymxc0" // Serial device speed UARTSpeed = 115200 )
var ( // Directory to optionally save backed up and written firmware images. CachePath = "" // OpenOCD binary path, if the path contains a slash it is tried // directly, otherwise it is searched in the directories named by the // PATH environment variable. OpenOCDPath = "openocd" )
Functions ¶
func ATSetInternalRCLFCK ¶
func ATSetInternalRCLFCK() (err error)
Set the low frequency clock source to the internal RC with default parameters recommended by Nordic SDK, using the AT+UPRODLFCLK command. (see nRF5_SDK_15.3.0_59ac345/components/softdevice/s132/headers/nrf_sdm.h).
func Disable ¶
func Disable() (err error)
Toggle BLE visibility to non discoverable (AT+UBTDM=1), non pairable (AT+UBTPM=1), non connectable (AT+UBTCM=1) and disable any BLE role (AT+UBTLE=0), finally permanently store current configuration (AT&W, AT+CPWROFF).
func Enable ¶
func Enable() (err error)
Toggle BLE visibility to always discoverable (AT+UBTDM=3), pairable (AT+UBTPM=2), connectable (AT+UBTCM=2) and set BLE role to peripheral (AT+UBTLE=2), finally permanently store current configuration (AT&W, AT+CPWROFF).
func EnterBootloaderMode ¶
func EnterBootloaderMode() (err error)
Enter bootloader mode by driving low SWITCH_1 (GPIO 27) and SWITCH_2 (GPIO 26) during a module reset cycle.
func EnterNormalMode ¶
func EnterNormalMode() (err error)
Enter normal mode by driving high SWITCH_1 (GPIO 27) and SWITCH_2 (GPIO 26) during a module reset cycle.
func Flash ¶
Write the nrf52.flash and nrf52.uicr regions. *IMPORTANT*: the `mass_erase` command is issued before starting the procedure, all data contained in the flash and uicr regions (including module MAC address and/or any other configuration) will be lost.
func FlashSetInternalRCLFCK ¶
func FlashSetInternalRCLFCK() (err error)
Set the low frequency clock source to the internal RC with default parameters recommended by Nordic SDK, by modifying the relevant area in the module flash. (see nRF5_SDK_15.3.0_59ac345/components/softdevice/s132/headers/nrf_sdm.h).
func GetDeviceManufacturer ¶
Get device manufacturer (AT+CGMI).
func GetDeviceSerial ¶
Get product serial number (AT+CGSN).
func GetSoftwareVersion ¶
Get software version (AT+CGMR).
func Info ¶
Assemble the device identification string from device manufacturer, model, product serial, software version and Bluetooth device name.
func SetDeviceName ¶
Set Bluetooth device name (AT+UBTLN="device name") and parmanently store the current configuration (AT+&W, AT+CPWROFF).
Types ¶
This section is empty.