public class GollumDongle
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
addressBluetoothDevice |
static int |
DUMMY_FILE_DESC |
static int |
GOLLUM_ERROR |
static int |
GOLLUM_MODE_BLE |
static int |
GOLLUM_MODE_USB |
static int |
GOLLUM_NOT_SUPPORTED |
static boolean |
GOLLUM_STATE_BUSY |
static boolean |
GOLLUM_STATE_FREE |
static int |
GOLLUM_SUCCESS |
GollumUsbManagerCallbacks |
gollumUsbManagerCallbacks
USB Event interceptor before calling application callbacks
These callbacks are called by bleListener and in turn call application callbacks
|
static int |
MAX_RETRY_BLE_AUTO_RECONNECT |
static int |
MODULATION_2FSK
2-FSK modulation.
|
static int |
MODULATION_4FSK
4-FSK modulation.
|
static int |
MODULATION_ASK_OOK
ASK_OOK modulation.
|
static int |
MODULATION_GFSK
GFSK modulation.
|
static int |
MODULATION_MSK
MSK modulation.
|
static int |
SPECAN_STOP_DELAY_BEFORE_RESET_MILLIS |
static int |
UNEXPECTED_RECONNECT_DELAY_MILLIS |
Constructor and Description |
---|
GollumDongle(android.content.Context context)
Constructor for interfacing with a PandwaRF.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlternativeDeviceNameToScanList(java.lang.String name)
Adds a device name to the list of alternative device names that can advertize and must be scanned
|
boolean |
bondDevice()
Start the bonding (pairing) process with the remote device.
|
boolean |
bondDevice(android.bluetooth.BluetoothDevice bluetoothDevice)
Start the bonding (pairing) process with the remote device.
|
boolean |
bondDevice(java.lang.String deviceAddress)
Start the bonding (pairing) process with the remote device.
|
int |
clearBondAllPandwaRFDevices()
Delete bond information for all known PandwaRF devices
|
boolean |
clearBondDevice()
Clear the bonding (pairing) process with the remote device.
|
boolean |
clearBondDevice(android.bluetooth.BluetoothDevice device)
Clear the bonding (pairing) process with the remote device.
|
boolean |
clearBondDevice(java.lang.String deviceAddress)
Clear the bonding (pairing) process with the remote device.
|
void |
closeDevice()
Close PandwaRF connection
|
void |
closeGollumBleDevice()
Close BLE device
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
closeGollumUsbDevice()
Close the USB device
|
void |
deleteBleErrorsFromGollum()
Send a write request to erase all BLE errors from dongle memory
|
void |
destroy()
Close all device connection.
|
void |
execButton(int button,
GollumCallbackGetInteger cb)
Execute the same action as physically pressing a button on the device
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
flushMsgQueue(int fileDesc,
GollumCallbackGetInteger cb)
Clear the incoming NPI message queue
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
forceCrashReport()
Force an app crash report
|
void |
forceResetDongleBusyState(java.lang.Boolean state)
Force the current state of the device to busy/free
Has no real effect on HW, only to recover from a status mismatch
|
java.util.ArrayList<java.lang.String> |
getAlternativeDeviceNameScanList()
Returns the list of alternative device names that can advertize and must be scanned
|
void |
getBatteryLevel()
Read the current battery level.
|
int |
getBondedDeviceCount(java.util.ArrayList<java.lang.String> deviceList)
Returns the number of bonded devices from the deviceList
|
int |
getBondedPandwaRfCount()
Returns the number of bonded PandwaRF
|
void |
getCc1111BootloaderVersion(int fileDesc,
GollumCallbackGetInteger cb)
Get CC1111 CCTL bootloader version string
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
getCc1111BuildType(GollumCallbackGetString cb)
Get CC1111 FW build type (GollumRfBigRogueCCtl, GollumRfBigCCtl, ...)
|
void |
getCc1111FirmwareVersion(GollumCallbackGetString cb)
Returns the CC1111 FW version
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
getCc1111RfRegisters(GollumCallbackGetMap<java.lang.String,java.lang.Byte> cb)
Return the list of CC1111 registers in a hashmap<name, value>.
|
java.lang.String |
getCurrentBleDeviceMacAddress()
Returns the current BLE device MAC address
|
java.lang.String |
getCurrentFirmwareCC1111Id()
Returns the current CC1111 FW version
|
java.lang.String |
getCurrentFirmwareNordicId()
Get current Firmware Nordic Id
|
java.lang.String |
getCurrentFirmwareVersion()
Returns the the current CC1111 firmware version
|
java.lang.String |
getCurrentSoftwareVersion()
Returns the the current Nordic software version
|
int |
getCurrentTrxMode()
Returns the current trx mode (USB or BLE)
|
HandleFirmwareCC1111 |
getHandleFirmwareCC1111() |
HandleFirmwareNordic |
getHandleFirmwareNordic() |
static GollumDongle |
getInstance(android.app.Activity parentActivity)
Returns a single instance of GollumDongle
|
static GollumDongle |
getInstance(android.content.Context context)
Returns a single instance of GollumDongle
|
void |
getJavaScriptLibVersions(GollumCallbackGetString cb)
Get the JavaScript engine version
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
getLastVersionCC1111(java.lang.String modelName,
java.lang.String hardwareRevision,
GollumCallbackGetString cb)
Query the server for last available CC1111 FW version for specified model/HW revision
|
void |
getLastVersionFirmwareCC1111(java.lang.String modelName,
java.lang.String hardwareRevision,
GollumCallbackGetString cb)
Query the server for last available CC1111 FW version number for specified model/HW revision
|
void |
getLastVersionFirmwareCC1111(java.lang.String modelName,
java.lang.String hardwareRevision,
java.lang.String currentSwVersionNordic,
GollumCallbackGetString cb)
Query the server for last available CC1111 FW version for specified model/HW revision
|
void |
getLastVersionFirmwareNordic(java.lang.String modelName,
java.lang.String hardwareRevision,
GollumCallbackGetString cb)
Query the server for last available Nordic FW version for specified model/HW revision
|
void |
getLastVersionNordic(java.lang.String modelName,
java.lang.String hardwareRevision,
GollumCallbackGetString cb)
Query the server for last available Nordic FW version for specified model/HW revision
|
java.lang.String |
getLibGitHash()
Returns the commit Id of Gollum Android Lib
|
java.lang.String |
getLibVersion()
Returns the version of Gollum Android Lib
|
void |
getNativeLibusbVersion(GollumCallbackGetString cb)
Returns version of libusb
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
getNativeLibVersion(GollumCallbackGetString cb)
Returns Gollum Native Lib version
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
NpiParameters |
getNpiParameters()
Get the current NPI parameters
|
java.lang.String |
getNrfToolboxLibVersion()
Returns the version of nRF toolbox Android Lib
|
void |
getRfTestList(byte[] rfTestList,
GollumCallbackGetInteger cb)
Return list of available RF self tests
No need for dongle to be connected so we dont pre-check connection
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
int |
getShadowCc1111BootloaderVersion()
Returns the device CC1111 bootloader version as last seen by the lib
|
java.lang.String |
getShadowCc1111BuildType()
Returns the device CC1111 build type as last seen by the lib
|
java.lang.String |
getShadowHwRevision()
Returns the device HW revision as last seen by the lib
|
java.lang.String |
getShadowModel()
Returns the device model as last seen by the lib
|
void |
getTrxInfo(int fileDesc,
GollumCallbackGetInteger cb)
Deprecated.
|
android.hardware.usb.UsbDevice |
getUsbDevice()
Returns current UsbDevice of connected device (if any)
|
java.lang.String |
getUsbDeviceName()
Returns current USB device name of connected device (if any)
|
int |
getUsbFileDesc()
Returns current USB file descriptor of connected device (if any)
|
void |
hardResetChip(int fileDesc,
GollumCallbackGetInteger cb)
Order the CC1111 chip to do a power off/power on sequence of the CC1111 using RESETn
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
static boolean |
hasFeatureBluetoothSmart()
Indicates if device has Bluetooth Smart feature
|
static boolean |
hasFeatureUsbHost()
Indicates if device has USB Host feature
|
static boolean |
hasInstance() |
boolean |
isAutoBleReconnectIfError() |
boolean |
isBleConnected() |
boolean |
isDeviceBonded() |
boolean |
isDeviceBonded(java.lang.String deviceAddress)
Check if the bond state of the remote device is bonded
|
boolean |
isDeviceConnected() |
boolean |
isDongleModeBootloader()
Indicates if dongle bootloader is running.
|
void |
isDongleModeBootloader(GollumCallbackGetBoolean cb)
Indicates if dongle bootloader is running.
|
boolean |
isDongleModeFirmware()
Indicates if dongle firmware is running.
|
void |
isDongleModeFirmware(GollumCallbackGetBoolean cb)
Indicates if dongle firmware is running.
|
void |
isFirmwareUpdateAvailable(java.lang.String modelName,
java.lang.String hardwareRevision,
GollumCallback cbOnFinish)
Check if a FW update (Nordic or CC1111) is available
|
boolean |
isPandwaRfRogue() |
boolean |
isPandwaRfRogueCc1111() |
boolean |
isPandwaRfRogueGov() |
boolean |
isPandwaRfRogueNordic() |
boolean |
isPandwaRfRoguePro() |
void |
isRegisteredRogue(GollumCallbackGetBoolean cb)
Ask the backend if the device is a registered Rogue and call the callback when information is available
|
boolean |
isUsbConnected() |
static boolean |
isUsbDeviceGollumBootloader(android.hardware.usb.UsbDevice device)
Indicates if device is connected in USB mode and Bootloader is running
|
static boolean |
isUsbDeviceGollumFirmware(android.hardware.usb.UsbDevice device)
Indicates if device is connected in USB mode and FW is running
|
int |
keeloq_dec(byte[] key,
byte[] ciphertext,
GollumCallbackGetByteArray cb)
Perform Keeloq decoding
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
int |
keeloq_enc(byte[] key,
byte[] plaintext,
GollumCallbackGetByteArray cb)
Perform Keeloq encoding
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
logStatisticEvent(java.lang.String eventName,
int param)
Log event to Firebase with int param
|
void |
logStatisticEvent(java.lang.String eventName,
java.lang.String param)
Log event to Firebase with String param
|
void |
notifButtonPushed(boolean active)
Deprecated.
Replaced by
writeNotifButtonPushed(boolean) |
void |
openGollumBleDevice(ExtendedBluetoothDevice device,
boolean autoConnect,
boolean reconnectIfError,
boolean refreshDeviceCacheBeforeConnect)
Deprecated.
|
void |
openGollumBleDevice(ExtendedBluetoothDevice device,
boolean autoConnect,
boolean reconnectIfError,
boolean refreshDeviceCacheBeforeConnect,
boolean useTxFifoQueue)
Open a device without setting the app callbacks.
|
void |
openGollumBleDevice(ExtendedBluetoothDevice device,
boolean autoConnect,
boolean reconnectIfError,
boolean refreshDeviceCacheBeforeConnect,
boolean useTxFifoQueue,
GollumBleManagerCallbacks bleManagerCallbacks)
Open a device and sets the app callbacks.
|
void |
openGollumBleDevice(ExtendedBluetoothDevice device,
boolean autoConnect,
boolean reconnectIfError,
boolean refreshDeviceCacheBeforeConnect,
GollumBleManagerCallbacks bleManagerCallbacks)
|
void |
openGollumBleDevice(java.lang.String deviceAddress,
boolean autoConnect,
boolean reconnectIfError,
boolean refreshDeviceCacheBeforeConnect)
Deprecated.
|
void |
openGollumBleDevice(java.lang.String deviceAddress,
boolean autoConnect,
boolean reconnectIfError,
boolean refreshDeviceCacheBeforeConnect,
boolean useTxFifoQueue)
Open a device from its address without setting the app callbacks.
|
void |
openGollumBleDeviceFirstFound(GollumBleManagerCallbacks bleManagerCallbacks,
ScannerListener scannerListener)
Connect to the first PandwaRF device found.
|
void |
openGollumUsbDevice(android.hardware.usb.UsbDevice device)
Connect with an USB device.
|
void |
pause()
Pause PandwaRF connection.
|
void |
ping(GollumCallbackGetInteger cb)
Make a dongle ping to device
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
pingInContext()
Make a dongle ping to device, but assuming we are already in a background task
Must be called from background thread
|
void |
powerMeasStart(int fileDesc,
int frequency,
GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
powerMeasStop(int fileDesc,
GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
readBatteryLevel() |
void |
readBleErrorsFirstErrorAndResetIndex()
Send a read request to read first BLE error from dongle memory
This will trigger a read received and next read requests will then be sent
|
void |
readBusConfig()
Ask to receive the status of the last action.
|
void |
readDeviceInformation()
Ask information about the current device
|
void |
readNotifBattery()
Ask to receive the status of Battery notification.
|
void |
readNotifButtonPushed()
Ask to receive the status of Button Pushed notification.
|
void |
readRollingCodeConfigFromFlash(GollumCallbackGetGeneric<RollingCodeTxConfig> cbOnFinish)
Reads a rolling code configuration from PandwaRF SPI Flash memory
|
void |
reconnect(java.lang.String address)
Reconnect to a given BLE address, or last BLE address used if address is null.
|
boolean |
reconnectUSB()
Reconnect to a USB device.
|
boolean |
refreshDeviceCache()
Clears the internal cache and forces a refresh of the services from the remote device.
|
int |
registerRead(int address,
byte[] buffer,
int bufLen)
Read a register from CC1111 RF
Same as registerRead, but assuming we are already in a background task
Must be called from background thread
|
void |
registerRead(int address,
byte[] buffer,
int bufLen,
GollumCallbackGetInteger cb)
Read a register from CC1111 RF
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
int |
registerWrite(int address,
byte[] buffer,
int bufLen)
Write to a register in CC1111 RF
Same as registerWrite, but assuming we are already in a background task
Must be called from background thread
|
void |
registerWrite(int address,
byte[] buffer,
int bufLen,
GollumCallbackGetInteger cb)
Write to a register in CC1111 RF
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
removeAllAlternativeDeviceNameFromScanList()
Removes all device names from the list of alternative device names that can advertize and must be scanned
|
java.lang.Boolean |
removeAlternativeDeviceNameFromScanList(java.lang.String name)
Removes a device name from the list of alternative device names that can advertize and must be scanned
|
void |
rfBruteForceAttackSetup(int fileDesc,
RfSetupParameters rfSetupParam,
BruteForceSetupParameters bfSetupParam,
GollumCallbackGetInteger cb)
Setup the Brute Force
Requires a Brute Force Start SyncCodeTail to start the BF
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
rfBruteForceAttackSetupFunction(int fileDesc,
java.lang.String functionMask,
java.lang.String functionValue,
GollumCallbackGetInteger cb)
Brute Force setup of the Function Mask and Value.
|
void |
rfBruteForceAttackSetupLongSymbol(int fileDesc,
RfSetupParameters rfSetupParam,
BruteForceSetupLongSymbolParameters bfSetupParam,
GollumCallbackGetInteger cb)
Setup the Brute Force with long symbols
Requires a Brute Force Start SyncCodeTail to start the BF
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
rfBruteForceAttackStart(int fileDesc,
RfSetupParameters rfSetupParam,
BruteForceStartParameters bfStartParam,
GollumCallbackGetInteger cb)
All in one message to start a Brute Force
Public version
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
rfBruteForceAttackStartSyncCodeTail(int fileDesc,
BruteForceStartSyncCodeTailParameters bfSctParam,
GollumCallbackGetInteger cb)
Start a Brute Force using previous parameters set in Setup Brute Force message
Requires a call to rfBruteForceAttackSetup() before
Only available in Rogue Gov variant
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
rfBruteForceAttackStatusUpdate(int fileDesc,
GollumCallbackGetInteger cb)
Returns get Brute Force status update value
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
rfBruteForceAttackStop(int fileDesc,
GollumCallbackGetInteger cb)
Stop the Brute Force attack
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
rfClose(int fileDesc,
GollumCallbackGetInteger cb)
Close RF link
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
int |
rfFreqFinderGetResult(int fileDesc)
Get An Array Describing the results of FreqFinder Session, assuming we are already in a background task
Must be called from background thread
|
int |
rfFreqFinderStart(int fileDesc,
int hint)
Starts frequency finder
|
int |
rfFreqFinderStop(int fileDesc)
Stop frequency finder in current Thread.
|
int |
rfGetTxRxPowerAmp(int fileDesc)
Get power Amplifiers mode, assuming we are already in a background task
Must be called from background thread
|
void |
rfGetTxRxPowerAmp(int fileDesc,
GollumCallbackGetInteger cb)
Get power Amplifiers mode
Native call will be done inside background task.
|
int |
rfJammingDetectorGetResult(int fileDesc)
Get the Status of Jamming Detector, assuming we are already in a background task
Must be called from background thread
|
int |
rfJammingDetectorStart(int fileDesc,
int sensitivity)
Start jamming detector
|
int |
rfJammingDetectorStop(int fileDesc)
Stop Jamming Detector in current Thread.
|
void |
rfJammingStart(int fileDesc,
int startFrequency,
int stopFrequency,
int dataRate,
int modulation,
GollumCallbackGetInteger cb)
Start RF jamming
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
rfJammingStop(int fileDesc,
GollumCallbackGetInteger cb)
Stop RF jamming
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
rfOpen(int fileDesc,
GollumCallbackGetInteger cb)
Open RF link
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
rfReconnect(GollumCallbackGetBoolean cb)
Close and re-open RF link and NPI packet interface.
|
void |
rfScan(GollumCallbackGetInteger cb)
Starts a rfScan in background task
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
int |
rfScanInContext()
Make a rfScan, but assuming we are already in a background task
Must be called from background thread
|
int |
rfSetTxRxPowerAmp(int fileDesc,
Common.RfPowerAmplifierMode powerMode)
Set power Amplifiers mode, assuming we are already in a background task
Must be called from background thread
|
void |
rfSetTxRxPowerAmp(int fileDesc,
Common.RfPowerAmplifierMode powerMode,
GollumCallbackGetInteger cb) |
int |
rfSetTxRxPowerAmp(int fileDesc,
int actionToPerform)
Set power Amplifiers mode, assuming we are already in a background task
Must be called from background thread
|
void |
rfSetTxRxPowerAmp(int fileDesc,
int actionToPerform,
GollumCallbackGetInteger cb)
Set power Amplifiers mode
Native call will be done inside background task.
|
int |
rfSpecanGetRssi(byte[] rssi_buffer,
int size)
Same as rfSpecanGetRssi, but assuming we are already in a background task
Must be called from background thread
|
void |
rfSpecanGetRssi(byte[] rssi_buffer,
int size,
GollumCallbackGetInteger cb)
Returns SpecAn RSSI measurements
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
rfSpecanSetPktDelay(int fileDesc,
int pkt_delay_ms,
GollumCallbackGetInteger cb)
Configure the delay between 2 Spectrum Analyzer packets
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
int |
rfSpecanStart(int fileDesc,
int basefreq,
int chanspc,
int numchan,
int pkt_delay_ms)
Starts Spectrum Analyzer in current Thread.
|
void |
rfSpecanStart(int fileDesc,
int basefreq,
int chanspc,
int numchan,
int pkt_delay_ms,
GollumCallbackGetInteger cb)
Starts Spectrum Analyzer in background task
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
int |
rfSpecanStop(int fileDesc)
Stop Spectrum Analyzer in current Thread.
|
void |
rfSpecanStop(int fileDesc,
GollumCallbackGetInteger cb)
Stop Spectrum Analyzer in background task
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
runBootloader(int fileDesc,
GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
runFirmware(int fileDesc,
GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
runRfTest(int test,
GollumCallbackGetInteger cb)
Run CC1111 RF test
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
int |
rxDataRateMeasListen()
Same as rxDataRateMeasListen, but assuming we are already in a background task
Must be called from background thread
|
int |
rxDataRateMeasStart(int frequency,
int modulation,
int dataRate,
int chanbw,
int deviation,
int threshold_occ_winner)
Measure data rate, assuming we are already in a background task
Must be called from background thread
|
int |
rxDataRateMeasStop()
Same as rxDataRateMeasStop, but assuming we are already in a background task
Must be called from background thread
|
int |
rxFlush(int fileDesc)
Removes all RX messages already in queue
Must be called from background thread
|
void |
rxFlush(int fileDesc,
GollumCallbackGetInteger cb)
Removes all RX messages already in queue
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
int |
rxListen(byte[] buffer,
int rx_size)
Start listening for RX data.
|
void |
rxListen(byte[] buffer,
int rx_size,
GollumCallbackGetInteger cb)
Start listening for RX data.
|
int |
rxSetup(int frequency,
int modulation,
int dataRate,
int frameLength,
int chanbw,
int deviation)
Same as rxSetup, but assuming we are already in a background task
Must be called from background thread
|
void |
rxSetup(int frequency,
int modulation,
int dataRate,
int frameLength,
int chanbw,
int deviation,
GollumCallbackGetInteger cb)
Configure Dongle for RX.
|
int |
rxStop()
Stop RX data reception.
|
void |
rxStop(GollumCallbackGetInteger cb)
Stop RX data reception.
|
void |
saveButtonConfigInFlash(int button,
int frequency,
int modulation,
int dataRate,
int repeat,
byte[] buffer,
GollumCallbackGetInteger cb)
Save a RF configuration into a physical button of the device.
|
void |
saveRollingCodeConfigInFlash(int codeWordSize,
int numSameACodeToTransmit,
int numSameBCodeToTransmit,
int numCodeToTransmit,
int codeFileSize,
int numCodeInCodeFile,
int nextCodeIndex,
byte[] buffer,
GollumCallback cbOnFinish,
GollumCallbackGetInteger cbOnProgress,
GollumCallbackGetInteger cbOnPageTotalUpdate) |
void |
searchDevice(ScannerListener scannerListener)
Search for any Gollum device around.
|
void |
searchDevice(ScannerListener scannerListener,
long scanDurationMs)
Search for any Gollum device around.
|
void |
sendJsFile(int fileDesc,
java.lang.String relativePath,
GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
setAlternativeDeviceNameScanList(java.util.ArrayList<java.lang.String> list)
Set the list of alternative device names that can advertize and must be scanned
This will create a new scanner
|
void |
setAutoBleReconnectIfError(boolean autoBleReconnectIfError)
Allow automatic BLE reconnection in case of BLE disconnection (GATT error, ...)
|
void |
setBitRate(int fileDesc,
int dataRate,
GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
setBleManagerAppCallbacks(GollumBleManagerCallbacks bleManagerCallbacks)
Register for BLE callbacks
|
void |
setCC1111RfRegisters(byte[] registerBuffer,
GollumCallbackGetInteger cb)
Write all CC1111 registers at once.
|
void |
setCC1111Sleep(int mode,
GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
setDongleBusyState(java.lang.Boolean busy,
Common.RfTask rfTask)
Set dongle busy or not more for a task, depending on the status the callback is called.
|
void |
setFilterBandwidth(int fileDesc,
int filter_bandwidth,
GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
setFrequency(int fileDesc,
int frequency,
GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
setLed(int led,
boolean val,
GollumCallbackGetInteger cb)
Deprecated.
Use
writeStateLed(int, boolean) instead. |
void |
setModulation(int fileDesc,
int modulation,
GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
setNativeNpiTimeout(int syncDhBleTimeOutMs,
int syncDhUsbTimeOutMs,
int rxThreadTimeoutMs,
GollumCallbackGetInteger cb)
Set values for different timeouts used in Gollum Native Lib.
|
void |
setNativeNpiTimeout(NpiParameters npiParams,
GollumCallbackGetInteger cb)
Set values for different timeouts used in Gollum Native Lib.
|
void |
setNativeNpiTimeout(java.lang.String timeoutStr,
GollumCallbackGetInteger cb)
Set values for different timeouts used in Gollum Native Lib
|
static void |
setOfflineMode(boolean mode)
Force the lib to enter specified network mode (offline/online).
|
static void |
setOfflineModeAnalytics(boolean mode)
Force the lib to enter specified network mode (offline/online) for logging and analytics backend
|
static void |
setOfflineModeBackend(boolean mode)
Force the lib to enter specified network mode (offline/online) for backend managing FW versions, BLE errors, database, etc...
|
static void |
setOfflineModeCrashReport(boolean mode)
Force the lib to enter specified network mode (offline/online) for logging events and app crashes
|
void |
setOutputPower(int fileDesc,
int power_dbm,
GollumCallbackGetInteger cb)
Sets 'standard' output power of CC1111
|
void |
setRfConfigPredefined(int fileDesc,
int config,
GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
setShouldSignalBattery(boolean notifActive)
Enable reception of the battery level notification.
|
void |
setShouldSignalRssi(boolean signalRssi)
Enable RSSI measurement of the connected device.
|
void |
setUsbManagerAppCallbacks(GollumUsbManagerCallbacks usbManagerCallbacks)
Register for USB callbacks
|
void |
signalBattery(boolean enable)
Deprecated.
Replaced by
setShouldSignalBattery(boolean) |
void |
signalRssi(boolean enable)
Deprecated.
Replaced by
setShouldSignalRssi(boolean) |
void |
softResetChip(int fileDesc,
GollumCallbackGetInteger cb)
Soft Reset the CC1111, using a gentle UART CMD to CC1111 (CMD_RESET: app=0xFF, cmd=0x8f)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
stopSearchDevice()
Stop BLE scanning for any PandwaRF device around.
|
int |
txFlush(int fileDesc)
Removes all TX messages already in queue
Must be called from background thread
|
void |
txFlush(int fileDesc,
GollumCallbackGetInteger cb)
Removes all TX messages already in queue
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
int |
txSend(byte[] buffer,
int tx_size,
boolean async,
int repeat)
Send data as a byte array in the form [0x41, 0x42, 0x30, 0x46, ...].
|
void |
txSend(byte[] buffer,
int tx_size,
boolean async,
int repeat,
GollumCallbackGetInteger cb)
Send data as a byte array in the form [0x41, 0x42, 0x30, 0x46, ...].
|
int |
txSendHex(byte[] buffer_hex,
int tx_size,
boolean async,
int repeat)
Send data as an hex byte array.
|
void |
txSendHex(byte[] buffer_hex,
int tx_size,
boolean async,
int repeat,
GollumCallbackGetInteger cb)
Send data as an hex byte array.
|
int |
txSetup(int frequency,
int modulation,
int dataRate,
int deviation)
Configure CC1111 radio before sending Tx message over radio interface
Same as txSetup, but assuming we are already in a background task
Must be called from background thread
|
void |
txSetup(int frequency,
int modulation,
int dataRate,
int deviation,
GollumCallbackGetInteger cb)
Configure CC1111 radio before sending Tx message over radio interface
Must NOT be called from background thread, as this method already creates its own AsyncTask.
|
void |
updateFirmwareCC1111(byte[] hexfile,
GollumCallback cbOnFinish,
GollumCallbackGetInteger cbOnProgress,
GollumCallbackGetProgressStatus cbOnFineProgress,
GollumCallbackGetInteger cbOnPageTotalUpdate)
Update CC1111 firmware with given HEX file.
|
void |
updateFirmwareCC1111(java.lang.String hexFilePath,
GollumCallback cbOnFinish,
GollumCallbackGetInteger cbOnProgress,
GollumCallbackGetProgressStatus cbOnFineProgress,
GollumCallbackGetInteger cbOnPageTotalUpdate)
Update CC1111 firmware with given HEX file.
|
void |
updateFirmwareCC1111WithLastVersion(GollumCallback cbOnFinish,
GollumCallbackGetInteger cbOnProgress,
GollumCallbackGetInteger cbOnPageTotalUpdate)
Update CC1111 firmware with last version
|
void |
updateFirmwareCC1111WithLastVersion(GollumCallback cbOnFinish,
GollumCallbackGetInteger cbOnProgress,
GollumCallbackGetProgressStatus cbOnFineProgress,
GollumCallbackGetInteger cbOnPageTotalUpdate)
Update CC1111 firmware with last version
|
void |
updateFirmwareCC1111WithVersion(FirmwareCC1111 fwCC1111,
GollumCallback cbOnFinish,
GollumCallbackGetInteger cbOnProgress,
GollumCallbackGetInteger cbOnPageTotalUpdate)
Deprecated.
|
void |
updateFirmwareCC1111WithVersion(FirmwareCC1111 fwCC1111,
GollumCallback cbOnFinish,
GollumCallbackGetInteger cbOnProgress,
GollumCallbackGetProgressStatus cbOnFineProgress,
GollumCallbackGetInteger cbOnPageTotalUpdate)
Update CC1111 firmware with given version.
|
void |
updateFirmwareNordic(java.lang.String mFilePath,
android.net.Uri mFileStreamUri,
java.lang.String mInitFilePath,
android.net.Uri mInitFileStreamUri,
boolean keepBond,
GollumCallback cbOnFinish,
GollumCallbackGetProgress cbOnProgress)
Start a Nordic FW update (DFU) procedure.
|
void |
updateFirmwareNordicWithLastVersion(GollumCallback cbDownloadStarted,
GollumCallback cbDownloadFinish,
GollumCallback cbOnFinish,
GollumCallbackGetInteger cbOnProgress)
Deprecated.
|
void |
updateFirmwareNordicWithLastVersion(GollumCallback cbDownloadStarted,
GollumCallback cbDownloadFinish,
GollumCallback cbOnFinish,
GollumCallbackGetProgress cbOnProgress)
Update the Firmware Nordic with last version
|
void |
updateFirmwareNordicWithVersion(FirmwareNordic fwNordic,
GollumCallback cbDownloadStarted,
GollumCallback cbDownloadFinish,
GollumCallback cbOnFinish,
GollumCallbackGetProgress cbOnProgress)
To update Nordic firmware with a given version
|
protected boolean |
usbScanAndOpen()
Search and connect with an usb device.
|
void |
writeBatteryCapacity(int capacity)
Set the battery capacity of dongle
|
void |
writeButtonPush(byte[] data)
Simulate the push on a button on the board.
|
void |
writeButtonPush(int button)
Simulate the push on a button on the board.
|
void |
writeDeviceName(java.lang.String deviceName)
Write PandwaRF advertizing name and device name.
|
void |
writeForceSleepNordic()
Force Nordic nRF51 chipset to enter sleep mode
|
void |
writeGetLastSelfTestResult()
Get last self test result
|
void |
writeHwRevision(byte[] data)
Set the HW revision of dongle.
|
void |
writeHwRevision(java.lang.String hw_rev)
Set the HW revision of dongle.
|
void |
writeLoopBackMode(boolean enable)
Set the LoopBack mode
|
void |
writeLoopBackMode(byte[] data)
Set the LoopBack mode.
|
void |
writeNotifBusConfig(boolean enable)
Enables/Disable Nordic BUS service notification
|
void |
writeNotifButtonPushed(boolean enable)
Activate the receipt of notifications when a button is pushed on the board.
|
void |
writeNotifRXCharacteristic(boolean enabled)
Enables/Disable Nordic UART Service (NUS) RX notification
|
void |
writeResetCC1111()
Reset Texas Instruments CC1111 chipset
|
void |
writeResetNordic()
Reset Nordic nRF51 chipset
|
void |
writeRunSelfTest()
Run self test
|
void |
writeStateLed(byte[] value)
Set the state of a led.
|
void |
writeStateLed(int led,
boolean state)
Set the state of a led.
|
boolean |
writeTXCharacteristic(byte[] value,
boolean useBleWriteWithAck)
Write data on the Nordic UART Service (NUS) TX characteristic
|
void |
writeTxRetryMode(boolean mode)
Set the TX retry mode to retry a BLE transmission when no TX buffer is available.
|
void |
writeTxRetryMode(byte[] data)
Set the TX retry mode to retry a BLE transmission when no TX buffer is available.
|
void |
writeUsbMode(boolean mode)
Enables/Disables the USB.
|
void |
writeUsbMode(byte[] data)
Enables/Disables the USB.
|
public static final int GOLLUM_MODE_USB
public static final int GOLLUM_MODE_BLE
public static final boolean GOLLUM_STATE_BUSY
public static final boolean GOLLUM_STATE_FREE
public static final int DUMMY_FILE_DESC
public static final int GOLLUM_SUCCESS
public static final int GOLLUM_ERROR
public static final int GOLLUM_NOT_SUPPORTED
public static final int MODULATION_ASK_OOK
public static final int MODULATION_2FSK
public static final int MODULATION_4FSK
public static final int MODULATION_GFSK
public static final int MODULATION_MSK
public static final int UNEXPECTED_RECONNECT_DELAY_MILLIS
public static final int MAX_RETRY_BLE_AUTO_RECONNECT
public static final int SPECAN_STOP_DELAY_BEFORE_RESET_MILLIS
public static java.lang.String addressBluetoothDevice
public GollumUsbManagerCallbacks gollumUsbManagerCallbacks
public GollumDongle(android.content.Context context)
getInstance(Activity)
or @link {#getInstance(Context)}context
- The calling context being used to instantiate the GollumDongle.public static GollumDongle getInstance(android.app.Activity parentActivity)
parentActivity
- parent activitypublic static GollumDongle getInstance(android.content.Context context)
context
- Associated contextpublic static boolean hasInstance()
public static void setOfflineMode(boolean mode)
setOfflineModeBackend(boolean)
+ setOfflineModeAnalytics(boolean)
+ setOfflineModeCrashReport(boolean)
mode
- true to enter complete offline mode, false to allow backend connection. Default to false.public static void setOfflineModeBackend(boolean mode)
mode
- true to enter offline mode, false to allow backend connection. Default to false.public static void setOfflineModeAnalytics(boolean mode)
mode
- true to enter offline mode, false to allow backend connection. Default to false.public static void setOfflineModeCrashReport(boolean mode)
mode
- true to enter offline mode, false to allow backend connection. Default to false.public void searchDevice(ScannerListener scannerListener)
scannerListener
- callbacks to be called when new device is found or scan endspublic void searchDevice(ScannerListener scannerListener, long scanDurationMs)
scannerListener
- callbacks to be called when new device is found or scan endsscanDurationMs
- duration in ms, 0 for infinite scan (only recommended when debugging)public void stopSearchDevice()
public void setAlternativeDeviceNameScanList(java.util.ArrayList<java.lang.String> list)
list
- ArrayList of alternative device names to be scanned forpublic java.util.ArrayList<java.lang.String> getAlternativeDeviceNameScanList()
public void addAlternativeDeviceNameToScanList(java.lang.String name)
name
- BLE advertizing name to be added for scanpublic java.lang.Boolean removeAlternativeDeviceNameFromScanList(java.lang.String name)
name
- BLE advertizing name to be removed for scanpublic void removeAllAlternativeDeviceNameFromScanList()
public void setBleManagerAppCallbacks(GollumBleManagerCallbacks bleManagerCallbacks)
bleManagerCallbacks
- BLE Callback to receive information about bluetooth notification.public boolean isDeviceBonded(java.lang.String deviceAddress)
deviceAddress
- address to check for bonding statuspublic boolean isDeviceBonded()
public boolean bondDevice(android.bluetooth.BluetoothDevice bluetoothDevice)
bluetoothDevice
- device to bondpublic boolean bondDevice(java.lang.String deviceAddress)
deviceAddress
- device address to bondpublic boolean bondDevice()
public boolean clearBondDevice(android.bluetooth.BluetoothDevice device)
device
- device to unbondpublic boolean clearBondDevice(java.lang.String deviceAddress)
deviceAddress
- address of device to unbondpublic boolean clearBondDevice()
public int getBondedPandwaRfCount()
public int getBondedDeviceCount(java.util.ArrayList<java.lang.String> deviceList)
deviceList
- to be checkedpublic int clearBondAllPandwaRFDevices()
public void setUsbManagerAppCallbacks(GollumUsbManagerCallbacks usbManagerCallbacks)
usbManagerCallbacks
- : USB Callback to receive information about bluetooth notification.public void openGollumBleDevice(java.lang.String deviceAddress, boolean autoConnect, boolean reconnectIfError, boolean refreshDeviceCacheBeforeConnect)
openGollumBleDevice(String, boolean, boolean, boolean, boolean)
deviceAddress
- address of device to open.autoConnect
- indicates whether to automatically connect to the BLE device as soon as it becomes available.reconnectIfError
- If true, allow automatic BLE reconnection in case of BLE disconnection (GATT error, ...)refreshDeviceCacheBeforeConnect
- If true, clears the internal cache and forces a refresh of the services from the remote device.public void openGollumBleDevice(java.lang.String deviceAddress, boolean autoConnect, boolean reconnectIfError, boolean refreshDeviceCacheBeforeConnect, boolean useTxFifoQueue)
deviceAddress
- address of device to open.autoConnect
- indicates whether to automatically connect to the BLE device as soon as it becomes available.reconnectIfError
- If true, allow automatic BLE reconnection in case of BLE disconnection (GATT error, ...)refreshDeviceCacheBeforeConnect
- If true, clears the internal cache and forces a refresh of the services from the remote device.useTxFifoQueue
- If true, enqueue all TX packets into a FIFO queue. De-queuing is done when onCharacteristicWrite() or others are called.public void openGollumBleDevice(ExtendedBluetoothDevice device, boolean autoConnect, boolean reconnectIfError, boolean refreshDeviceCacheBeforeConnect)
openGollumBleDevice(ExtendedBluetoothDevice, boolean, boolean, boolean, boolean)
device
- Bluetooth device to connect to.autoConnect
- Whether to directly connect to the remote device (false).
or to automatically connect as soon as the remote device becomes available (true).reconnectIfError
- If true, allow automatic BLE reconnection in case of BLE disconnection (GATT error, ...).refreshDeviceCacheBeforeConnect
- If true, clears the internal cache and forces a refresh of the services from the remote device.public void openGollumBleDevice(ExtendedBluetoothDevice device, boolean autoConnect, boolean reconnectIfError, boolean refreshDeviceCacheBeforeConnect, boolean useTxFifoQueue)
device
- Bluetooth device to connect to.autoConnect
- Whether to directly connect to the remote device (false).
or to automatically connect as soon as the remote device becomes available (true).reconnectIfError
- If true, allow automatic BLE reconnection in case of BLE disconnection (GATT error, ...).refreshDeviceCacheBeforeConnect
- If true, clears the internal cache and forces a refresh of the services from the remote device.useTxFifoQueue
- If true, enqueue all TX packets into a FIFO queue. De-queuing is done when onCharacteristicWrite() or others are called.public void openGollumBleDevice(ExtendedBluetoothDevice device, boolean autoConnect, boolean reconnectIfError, boolean refreshDeviceCacheBeforeConnect, GollumBleManagerCallbacks bleManagerCallbacks)
openGollumBleDevice(ExtendedBluetoothDevice, boolean, boolean, boolean, boolean, GollumBleManagerCallbacks)
device
- Bluetooth device to connect to.autoConnect
- indicates whether to automatically connect to the BLE device as soon as it becomes available.reconnectIfError
- If true, allow automatic BLE reconnection in case of BLE disconnection (GATT error, ...).refreshDeviceCacheBeforeConnect
- If true, clears the internal cache and forces a refresh of the services from the remote device.bleManagerCallbacks
- BLE Callback to receive information about bluetooth notification.public void openGollumBleDevice(ExtendedBluetoothDevice device, boolean autoConnect, boolean reconnectIfError, boolean refreshDeviceCacheBeforeConnect, boolean useTxFifoQueue, GollumBleManagerCallbacks bleManagerCallbacks)
device
- Bluetooth device to connect to.autoConnect
- indicates whether to automatically connect to the BLE device as soon as it becomes available.reconnectIfError
- If true, allow automatic BLE reconnection in case of BLE disconnection (GATT error, ...).refreshDeviceCacheBeforeConnect
- If true, clears the internal cache and forces a refresh of the services from the remote device.useTxFifoQueue
- If true, enqueue all TX packets into a FIFO queue. De-queuing is done when onCharacteristicWrite() or others are called.bleManagerCallbacks
- BLE Callback to receive information about bluetooth notification.public void openGollumBleDeviceFirstFound(GollumBleManagerCallbacks bleManagerCallbacks, ScannerListener scannerListener)
bleManagerCallbacks
- Callback to receive information about bluetooth notification.scannerListener
- Callback to receive information about the scan.public void closeDevice()
public void closeGollumBleDevice()
Must NOT be called from background thread, as this method already creates its own AsyncTask.
public boolean refreshDeviceCache()
public void setShouldSignalRssi(boolean signalRssi)
signalRssi
- true to enable RSSI measurements.public void setShouldSignalBattery(boolean notifActive)
notifActive
- true to request PandwaRF device to send periodic battery level notificationpublic static boolean hasFeatureUsbHost()
public static boolean hasFeatureBluetoothSmart()
public static boolean isUsbDeviceGollumBootloader(android.hardware.usb.UsbDevice device)
device
- UsbDevice to check.public static boolean isUsbDeviceGollumFirmware(android.hardware.usb.UsbDevice device)
device
- UsbDevice to check.public void getLastVersionFirmwareCC1111(java.lang.String modelName, java.lang.String hardwareRevision, GollumCallbackGetString cb)
modelName
- model name of the PandwaRF to checkhardwareRevision
- HW revision of the PandwaRF to checkcb
- Callback to call with result when the background task is terminatedGollumCallbackGetString
public void getLastVersionFirmwareCC1111(java.lang.String modelName, java.lang.String hardwareRevision, java.lang.String currentSwVersionNordic, GollumCallbackGetString cb)
modelName
- Model name of the PandwaRF to checkhardwareRevision
- HW revision of the PandwaRF to checkcurrentSwVersionNordic
- Nordic FW version of the PandwaRF to check. CC1111 FW versions will be checked only if compatible with this Nordic SW version.cb
- Callback to be called with the result of operation, when the background task is terminated.GollumCallbackGetString
public java.lang.String getCurrentFirmwareCC1111Id()
public void updateFirmwareCC1111WithLastVersion(GollumCallback cbOnFinish, GollumCallbackGetInteger cbOnProgress, GollumCallbackGetInteger cbOnPageTotalUpdate)
cbOnFinish
- Callback to call when the FW update is finished.cbOnProgress
- Callback to call periodically with FW update progress status.cbOnPageTotalUpdate
- Callback to call with total number of pages to be flashed.GollumCallback
,
GollumCallbackGetInteger
public void updateFirmwareCC1111WithLastVersion(GollumCallback cbOnFinish, GollumCallbackGetInteger cbOnProgress, GollumCallbackGetProgressStatus cbOnFineProgress, GollumCallbackGetInteger cbOnPageTotalUpdate)
cbOnFinish
- Callback to call when the FW update is finished.cbOnProgress
- Callback to call periodically with FW update progress status.cbOnFineProgress
- Callback to call periodically with FW update progress status (one call per packet progress).cbOnPageTotalUpdate
- Callback to call with total number of pages to be flashed.GollumCallback
,
GollumCallbackGetInteger
public void updateFirmwareCC1111WithVersion(FirmwareCC1111 fwCC1111, GollumCallback cbOnFinish, GollumCallbackGetInteger cbOnProgress, GollumCallbackGetInteger cbOnPageTotalUpdate)
fwCC1111
- Object representing a PandwaRF CC1111 firmware.cbOnFinish
- Callback to call when the FW update is finished.cbOnProgress
- Callback to call periodically with FW update progress status.cbOnPageTotalUpdate
- Callback to call with total number of pages to be flashed.GollumCallback
,
GollumCallbackGetInteger
public void updateFirmwareCC1111WithVersion(FirmwareCC1111 fwCC1111, GollumCallback cbOnFinish, GollumCallbackGetInteger cbOnProgress, GollumCallbackGetProgressStatus cbOnFineProgress, GollumCallbackGetInteger cbOnPageTotalUpdate)
fwCC1111
- Object representing a PandwaRF CC1111 firmware.cbOnFinish
- Callback to call when the FW update is finished.cbOnProgress
- Callback to call periodically with FW update progress status.cbOnFineProgress
- Callback to call periodically with FW update progress status (one call per packet progress).cbOnPageTotalUpdate
- Callback to call with total number of pages to be flashed.GollumCallback
,
GollumCallbackGetInteger
public void getLastVersionFirmwareNordic(java.lang.String modelName, java.lang.String hardwareRevision, GollumCallbackGetString cb)
modelName
- model name of the PandwaRF to checkhardwareRevision
- HW revision of the PandwaRF to checkcb
- : Callback to be called with the result of operation, when the background task is terminated.GollumCallbackGetString
public java.lang.String getCurrentFirmwareNordicId()
public void updateFirmwareNordicWithLastVersion(GollumCallback cbDownloadStarted, GollumCallback cbDownloadFinish, GollumCallback cbOnFinish, GollumCallbackGetInteger cbOnProgress)
cbDownloadStarted
- callback to call when the firmware download has startedcbDownloadFinish
- Callback to call when the firmware download is terminatedcbOnFinish
- Callback to call when the FW update is finished.cbOnProgress
- Callback to call when the FW update background task is in progressGollumCallback
,
GollumCallbackGetInteger
public void updateFirmwareNordicWithLastVersion(GollumCallback cbDownloadStarted, GollumCallback cbDownloadFinish, GollumCallback cbOnFinish, GollumCallbackGetProgress cbOnProgress)
cbDownloadStarted
- callback to call when the firmware download has startedcbDownloadFinish
- Callback to call when the firmware download is terminatedcbOnFinish
- Callback to call when the FW update is finished.cbOnProgress
- Callback to call when the FW update background task is in progressGollumCallback
,
GollumCallbackGetProgress
public void updateFirmwareNordicWithVersion(FirmwareNordic fwNordic, GollumCallback cbDownloadStarted, GollumCallback cbDownloadFinish, GollumCallback cbOnFinish, GollumCallbackGetProgress cbOnProgress)
fwNordic
- Object representing a PandwaRF Nordic firmware.cbDownloadStarted
- callback to call when the firmware download has startedcbDownloadFinish
- Callback to call when the firmware download is terminatedcbOnFinish
- Callback to call when the FW update is finished.cbOnProgress
- Callback to call when the FW update background task is in progresspublic void updateFirmwareNordic(java.lang.String mFilePath, android.net.Uri mFileStreamUri, java.lang.String mInitFilePath, android.net.Uri mInitFileStreamUri, boolean keepBond, GollumCallback cbOnFinish, GollumCallbackGetProgress cbOnProgress)
setAutoBleReconnectIfError(boolean)
mFilePath
- the path of the file (if null, mFileStreamUri must not be null)mFileStreamUri
- the URI of the file (if null, mFilePath must not be null)mInitFilePath
- the path of the init file - used only for DFU Bootloader version pre-0.5 (SDK 4.3, 6.0, 6.1)mInitFileStreamUri
- the URI of the init file - used only for DFU Bootloader version pre-0.5 (SDK 4.3, 6.0, 6.1)keepBond
- whether the bond information should be preserved in the new application.cbOnFinish
- Callback to call when the FW update is finished.cbOnProgress
- Callback to call when the FW update background task is in progressGollumCallback
,
GollumCallbackGetProgress
public void isFirmwareUpdateAvailable(java.lang.String modelName, java.lang.String hardwareRevision, GollumCallback cbOnFinish)
modelName
- model name of the PandwaRF to checkhardwareRevision
- HW revision of the PandwaRF to checkcbOnFinish
- Callback to be called with the result of operation, when the background task is terminated.public void saveRollingCodeConfigInFlash(int codeWordSize, int numSameACodeToTransmit, int numSameBCodeToTransmit, int numCodeToTransmit, int codeFileSize, int numCodeInCodeFile, int nextCodeIndex, byte[] buffer, GollumCallback cbOnFinish, GollumCallbackGetInteger cbOnProgress, GollumCallbackGetInteger cbOnPageTotalUpdate)
codeWordSize
- Size of Code Word.numSameACodeToTransmit
- Number of A codes to be transmitted.numSameBCodeToTransmit
- Number of B codes to be transmitted.numCodeToTransmit
- Number of A+B codes to be transmitted.codeFileSize
- Size of file in bytes.numCodeInCodeFile
- Number of codes in file.nextCodeIndex
- Index of next rolling code to use.buffer
- Data buffer containing the codes to write.cbOnFinish
- Callback to call when the writing in flash is finished.cbOnProgress
- Callback to call when the writing in flash is in progress.cbOnPageTotalUpdate
- Callback to call when the number of pages to write in flash is known.public void readRollingCodeConfigFromFlash(GollumCallbackGetGeneric<RollingCodeTxConfig> cbOnFinish)
cbOnFinish
- Callback to call when the reading from flash is finished.public java.lang.String getLibVersion()
public java.lang.String getLibGitHash()
public java.lang.String getNrfToolboxLibVersion()
public java.lang.String getCurrentSoftwareVersion()
public java.lang.String getCurrentFirmwareVersion()
public void getBatteryLevel()
public java.lang.String getCurrentBleDeviceMacAddress()
public java.lang.String getShadowModel()
public java.lang.String getShadowHwRevision()
public java.lang.String getShadowCc1111BuildType()
public int getShadowCc1111BootloaderVersion()
public boolean writeTXCharacteristic(byte[] value, boolean useBleWriteWithAck)
value
- data to write as a byte array.useBleWriteWithAck
- True to perform a write with response (slower, but with ack), false to perform a write without response (faster, but no ack).public void writeNotifRXCharacteristic(boolean enabled)
enabled
- Set to true to enable notifications/indicationspublic void writeNotifBusConfig(boolean enable)
enable
- Set to true to enable notificationspublic void writeResetNordic()
public void writeForceSleepNordic()
public void writeResetCC1111()
public void writeRunSelfTest()
public void writeGetLastSelfTestResult()
public boolean isBleConnected()
public boolean isUsbConnected()
public boolean isDeviceConnected()
public boolean isPandwaRfRogue()
public boolean isPandwaRfRogueNordic()
public boolean isPandwaRfRogueCc1111()
public boolean isPandwaRfRoguePro()
public boolean isPandwaRfRogueGov()
public void isRegisteredRogue(GollumCallbackGetBoolean cb)
cb
- Callback to be called with the result of operation, when the background task is terminated.public void writeLoopBackMode(boolean enable)
enable
- Set to true to enable notifications/indicationspublic void writeLoopBackMode(byte[] data)
data
- Raw data to write to the BUS config for loopback mode command.public void writeUsbMode(boolean mode)
mode
- True to enable USB, false to disable.public void writeUsbMode(byte[] data)
data
- Raw data to write to the BUS config for USB mode.public void writeTxRetryMode(boolean mode)
mode:
- false: no retransmission if TX fails
true: Retry TX when no TX buffer availablepublic void writeTxRetryMode(byte[] data)
data
- Raw data to write to the BUS config for TX retry mode.public void writeHwRevision(java.lang.String hw_rev)
hw_rev
- HW Revision string to be written in PandwaRF memory.public void writeHwRevision(byte[] data)
data
- Raw data to write to the BUS config for HW revision command.public void writeBatteryCapacity(int capacity)
capacity
- in mAh, 0 if no battery connectedpublic void writeNotifButtonPushed(boolean enable)
enable
- Set to true to enable notifications/indicationspublic void readDeviceInformation()
public void getLastVersionCC1111(java.lang.String modelName, java.lang.String hardwareRevision, GollumCallbackGetString cb)
modelName
- model name of the PandwaRF to checkhardwareRevision
- HW revision of the PandwaRF to checkcb
- Callback to be called with the result of operation, when the background task is terminated.public void getLastVersionNordic(java.lang.String modelName, java.lang.String hardwareRevision, GollumCallbackGetString cb)
modelName
- model name of the PandwaRF to checkhardwareRevision
- HW revision of the PandwaRF to checkcb
- Callback to call when the background task is terminatedpublic void writeStateLed(int led, boolean state)
led
- LED Id. Range [1, 4].state
- True for LED on, false for LED off.public void writeStateLed(byte[] value)
value
- Raw data to write to the BUS config for LED command.public void writeButtonPush(int button)
button
- Id of the button. Range [1, 4].public void writeButtonPush(byte[] data)
data
- Raw data to write to the BUS config for button push command.public void writeDeviceName(java.lang.String deviceName)
deviceName
- New PandwaRF device advertizing name.public void readNotifButtonPushed()
public void readNotifBattery()
public void readBusConfig()
public void readBatteryLevel()
public void readBleErrorsFirstErrorAndResetIndex()
public void deleteBleErrorsFromGollum()
public void closeGollumUsbDevice()
public int getCurrentTrxMode()
public void destroy()
public void reconnect(java.lang.String address)
address
- BLE device address to reconnect to.public boolean reconnectUSB()
public void pause()
public void signalRssi(boolean enable)
setShouldSignalRssi(boolean)
enable
- Set to true to enable RSSI signal measurement.public void signalBattery(boolean enable)
setShouldSignalBattery(boolean)
enable
- Set to true to enable battery level reception.public void notifButtonPushed(boolean active)
writeNotifButtonPushed(boolean)
active
- Set to true to enable notifications/indicationspublic void openGollumUsbDevice(android.hardware.usb.UsbDevice device)
device
- USB device open.protected boolean usbScanAndOpen()
public android.hardware.usb.UsbDevice getUsbDevice()
public int getUsbFileDesc()
public java.lang.String getUsbDeviceName()
public void rfOpen(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public void rfClose(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public void rfReconnect(GollumCallbackGetBoolean cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
cb
- returns true if a NPI interface was closed, false if nothing was donepublic void flushMsgQueue(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public void softResetChip(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public void hardResetChip(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public void setRfConfigPredefined(int fileDesc, int config, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.config
- Preddefined configuration Idcb
- Callback to be called with the result of operation, when the background task is terminated.public void setFrequency(int fileDesc, int frequency, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.frequency
- The frequency to use in Hzcb
- Callback to be called with the result of operation, when the background task is terminated.public void rfJammingStart(int fileDesc, int startFrequency, int stopFrequency, int dataRate, int modulation, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.startFrequency
- The start Frequency to use in HzstopFrequency
- The stop Frequency to use in Hz*dataRate
- Target data rate, in bits/s.modulation
- The modulation value to use. Cf. Common.getModulationValue(String)
for possible valuescb
- Callback to be called with the result of operation, when the background task is terminated.Common.getModulationValue(String)
public void rfJammingStop(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public void rfBruteForceAttackSetup(int fileDesc, RfSetupParameters rfSetupParam, BruteForceSetupParameters bfSetupParam, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.rfSetupParam
- Radio parameters to use.bfSetupParam
- Brute Force parameters to use.cb
- Callback to be called with the result of operation, when the background task is terminated.public void rfBruteForceAttackSetupLongSymbol(int fileDesc, RfSetupParameters rfSetupParam, BruteForceSetupLongSymbolParameters bfSetupParam, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.rfSetupParam
- Radio parameters to use.bfSetupParam
- Brute Force parameters to use.cb
- Callback to be called with the result of operation, when the background task is terminated.public void rfBruteForceAttackSetupFunction(int fileDesc, java.lang.String functionMask, java.lang.String functionValue, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.functionMask
- This is like a Mask IP Address. Every symbol noted FF is brute-forced, and every symbol noted 00 is fixed.functionValue
- This is the "contrary" of functionMask. Every symbol noted 00 is not fixed, and every symbol that you want to be fixed needs to be set here.cb
- Callback to be called with the result of operation, when the background task is terminated.public void rfBruteForceAttackStart(int fileDesc, RfSetupParameters rfSetupParam, BruteForceStartParameters bfStartParam, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.rfSetupParam
- Radio parameters to use.bfStartParam
- Brute Force parameters to use.cb
- Callback to be called with the result of operation, when the background task is terminated.public void rfBruteForceAttackStartSyncCodeTail(int fileDesc, BruteForceStartSyncCodeTailParameters bfSctParam, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.bfSctParam
- Brute Force parameters to use.cb
- Callback to be called with the result of operation, when the background task is terminated.public void rfBruteForceAttackStop(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public int rfSetTxRxPowerAmp(int fileDesc, Common.RfPowerAmplifierMode powerMode)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.powerMode
- cf. Common.RfPowerAmplifierMode
public int rfSetTxRxPowerAmp(int fileDesc, int actionToPerform)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0. File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.actionToPerform
- Power amplifier modeCommon.RfPowerAmplifierMode
public void rfSetTxRxPowerAmp(int fileDesc, Common.RfPowerAmplifierMode powerMode, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.powerMode
- cf. Common.RfPowerAmplifierMode
cb
- Callback to be called with the TX/RX power amplifier mode, when the background task is terminated.public void rfSetTxRxPowerAmp(int fileDesc, int actionToPerform, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.actionToPerform
- Power amplifier modecb
- Callback to be called with the result of operation, when the background task is terminated.Common.RfPowerAmplifierMode
public int rfGetTxRxPowerAmp(int fileDesc)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.Common.RfPowerAmplifierMode
public void rfGetTxRxPowerAmp(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the TX/RX power amplifier mode, when the background task is terminated.Common.RfPowerAmplifierMode
public void rfBruteForceAttackStatusUpdate(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public void setOutputPower(int fileDesc, int power_dbm, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.power_dbm
- TX output power in dBm.cb
- Callback to be called with the result of operation, when the background task is terminated.public void setBitRate(int fileDesc, int dataRate, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.dataRate
- Set the TX/RX data rate to use for PandwaRF transmission/reception. In bits/s.cb
- Callback to be called with the result of operation, when the background task is terminated.public void setModulation(int fileDesc, int modulation, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.modulation
- The modulation value to use. Cf. Common.getModulationValue(String)
for possible valuescb
- Callback to be called with the result of operation, when the background task is terminated.Common.getModulationValue(String)
public void setFilterBandwidth(int fileDesc, int filter_bandwidth, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.filter_bandwidth
- Receiver Channel Filter Bandwidth, in Hz. Range: [53571, 812500]. For best performance, the channel filter
bandwidth should be selected so that the signal bandwidth occupies at most 80% of the channel filter bandwidth.cb
- Callback to be called with the result of operation, when the background task is terminated.public void sendJsFile(int fileDesc, java.lang.String relativePath, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.relativePath
- Path of JS file to execute.cb
- Callback to be called with the result of operation, when the background task is terminated.public void rxFlush(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated. with number of RX messages destroyed, 0 if no message destroyedpublic int txFlush(int fileDesc)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.public void txFlush(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to call when the FW update is finished, with number of TX messages destroyed, 0 if no message destroyedpublic int rxFlush(int fileDesc)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.public void getTrxInfo(int fileDesc, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public void powerMeasStart(int fileDesc, int frequency, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.frequency
- The frequency to use in Hzcb
- Callback to be called with the result of operation, when the background task is terminated.public void powerMeasStop(int fileDesc, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public int rfScanInContext()
public void rfScan(GollumCallbackGetInteger cb)
cb
- Callback to be called with the result of operation, when the background task is terminated.public int rfSpecanStart(int fileDesc, int basefreq, int chanspc, int numchan, int pkt_delay_ms)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.basefreq
- Start frequency in Hz (ex: 433920000)chanspc
- frequency increment in Hz (ex: 25000 Hz)numchan
- number of channels (ex: 51 channels)pkt_delay_ms
- delay in ms between packetspublic void rfSpecanStart(int fileDesc, int basefreq, int chanspc, int numchan, int pkt_delay_ms, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.basefreq
- Start frequency in Hz (ex: 433920000)chanspc
- frequency increment in Hz (ex: 25000 Hz)numchan
- number of channels (ex: 51 channels)pkt_delay_ms
- delay in ms between packetscb
- Callback to be called with the result of operation, when the background task is terminated.public int rfSpecanGetRssi(byte[] rssi_buffer, int size)
rssi_buffer
- Buffer to store the RSSI values received from PandwaRF. Buffer size mus be equal to number of channels given in rfSpecanStart(int, int, int, int, int)
.size
- Buffer size.public void rfSpecanGetRssi(byte[] rssi_buffer, int size, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
rssi_buffer
- Buffer to store the RSSI values received from PandwaRF. Buffer size mus be equal to number of channels given in rfSpecanStart(int, int, int, int, int)
.size
- Buffer size.cb
- Callback to be called with the result of operation, when the background task is terminated.public void rfSpecanSetPktDelay(int fileDesc, int pkt_delay_ms, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.pkt_delay_ms
- delay in ms between packets (max 255 ms)cb
- Callback to be called with the result of operation, when the background task is terminated.public void rfSpecanStop(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public int rfSpecanStop(int fileDesc)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.public int rfFreqFinderStart(int fileDesc, int hint)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.hint
- (not used)public int rfFreqFinderStop(int fileDesc)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.public int rfFreqFinderGetResult(int fileDesc)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.public int rfJammingDetectorStart(int fileDesc, int sensitivity)
sensitivity
- a value between 0 and 10, to denote Jamming Detector sensitivity to Jamming,
the smallest this value is the more the signal has to be continuous to be considered as Jamming.fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.public int rfJammingDetectorGetResult(int fileDesc)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.public int rfJammingDetectorStop(int fileDesc)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.public void setLed(int led, boolean val, GollumCallbackGetInteger cb)
writeStateLed(int, boolean)
instead.led
- LED Id. Range [1, 4].val
- True for LED on, false for LED off.cb
- Callback to be called with the result of operation, when the background task is terminated.public void setCC1111Sleep(int mode, GollumCallbackGetInteger cb)
mode
- CC1111 power sleep mode.cb
- Callback to be called with the result of operation, when the background task is terminated.public void updateFirmwareCC1111(java.lang.String hexFilePath, GollumCallback cbOnFinish, GollumCallbackGetInteger cbOnProgress, GollumCallbackGetProgressStatus cbOnFineProgress, GollumCallbackGetInteger cbOnPageTotalUpdate)
See updateFirmwareCC1111(byte[], GollumCallback, GollumCallbackGetInteger, GollumCallbackGetProgressStatus, GollumCallbackGetInteger)
for details.
hexFilePath
- Path of CC1111 FW file in hex format.cbOnFinish
- Callback to call when the background task is terminated.cbOnProgress
- Callback to call periodically with FW update progress status (one call per page progress. Eg. 30 pages).cbOnFineProgress
- Callback to call periodically with FW update progress status (one call per packet progress. Eg. 50 packets per page).cbOnPageTotalUpdate
- Callback to call with total number of pages to be flashed. Called once at beginning of FW update.GollumCallback
,
GollumCallbackGetInteger
public void updateFirmwareCC1111(byte[] hexfile, GollumCallback cbOnFinish, GollumCallbackGetInteger cbOnProgress, GollumCallbackGetProgressStatus cbOnFineProgress, GollumCallbackGetInteger cbOnPageTotalUpdate)
When called, the hex file is analyzed and callback cbOnPageTotalUpdate
is called with total number of pages to be flashed (N).
During FW update, cbOnProgress
is called after each page is successfully written to CC1111. Pages generally range from 1 to N=30, but this may vary
according to FW size.
If cbOnFineProgress
is not null, it is called once a BLE packet composing the page has been sent.
The cbOnFineProgress
is filled with total
which is the total number of BLE packets needed to complete a frame (generally 55) and
progress
which is the number of the last transmitted packet.
After the last page has been written, cbOnFinish
is called.
The complete sequence is the following:
cbOnPageTotalUpdate
cbOnProgress
page: 1
cbOnFineProgress
progress: 0, total: 55
cbOnFineProgress
progress: 1, total: 55
cbOnFineProgress
progress: 2, total: 55
cbOnFineProgress
...
cbOnFineProgress
progress: 54, total: 55
cbOnProgress
page: 2
cbOnFineProgress
progress: 0, total: 55
cbOnFineProgress
...
cbOnFineProgress
progress: 54, total: 55
cbOnProgress
page: N
cbOnFineProgress
progress: 0, total: 55
cbOnFineProgress
...
cbOnFineProgress
progress: 54, total: 55
cbOnFinish
hexfile
- CC1111 FW file in hex format.cbOnFinish
- Callback to call when the background task is terminated.cbOnProgress
- Callback to call periodically with FW update progress status (one call per page progress. Eg. 30 pages).cbOnFineProgress
- Callback to call periodically with FW update progress status (one call per packet progress. Eg. 50 packets per page).cbOnPageTotalUpdate
- Callback to call with total number of pages to be flashed. Called once at beginning of FW update.GollumCallback
,
GollumCallbackGetInteger
,
GollumCallbackGetProgressStatus
,
GollumCallbackGetProgressStatus.done(String, String, int, int, GollumException)
public void getCc1111FirmwareVersion(GollumCallbackGetString cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
cb
- Callback to be called with the result of operation, when the background task is terminated.public void getCc1111BuildType(GollumCallbackGetString cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
cb
- Callback to be called with the result of operation, when the background task is terminated.public void getCc1111BootloaderVersion(int fileDesc, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public void runFirmware(int fileDesc, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public void runBootloader(int fileDesc, GollumCallbackGetInteger cb)
fileDesc
- File descriptor of PandwaRF device. Only used when sending command over USB. For command sent over BLE, use 0.cb
- Callback to be called with the result of operation, when the background task is terminated.public int txSetup(int frequency, int modulation, int dataRate, int deviation)
frequency
- The frequency to use, in Hz.modulation
- The modulation value to use. Cf. Common.getModulationValue(String)
for possible valuesdataRate
- Transmission data rate, in bits/s.deviation
- Channel deviation, in Hz. Only used for 2-FSK/GFSK/MSK.Common.getModulationValue(String)
public void txSetup(int frequency, int modulation, int dataRate, int deviation, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
frequency
- The frequency to use, in Hz.modulation
- The modulation value to use. Cf. Common.getModulationValue(String)
for possible valuesdataRate
- Transmission data rate, in bits/s.deviation
- Channel deviation, in Hz. Only used for 2-FSK/GFSK/MSK.cb
- Callback to be called with the result of operation, when the background task is terminated.Common.getModulationValue(String)
public int txSend(byte[] buffer, int tx_size, boolean async, int repeat)
buffer
- as a byte array in the form [0x41, 0x42, 0x30, 0x46, ...]. Data is not sent to PandwaRF in this form. Internally converted to hex byte array before sending.tx_size
- Not used.async
- true to send in async mode, false to send in sync moderepeat
- number of SW or HW repeat times: 1 = single TX, 2 = 2 TX, etc. If data buffer fits into 1 frame, repeat is handled by FW.
If data buffer is longer than 1 frame, repeat is handled by SW.public int txSendHex(byte[] buffer_hex, int tx_size, boolean async, int repeat)
buffer_hex
- an hex byte array in the form [0xAB, 0x0F, 0x00, 0xFF, ...]. Data can be sent to PandwaRF in this form. No internally conversion before sending.tx_size
- Not used.async
- true to send in async mode, false to send in sync moderepeat
- number of SW or HW repeat times: 1 = single TX, 2 = 2 TX, etc. If data buffer fits into 1 frame, repeat is handled by FW.
If data buffer is longer than 1 frame, repeat is handled by SW.public void txSend(byte[] buffer, int tx_size, boolean async, int repeat, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
buffer
- as a byte array in the form [0x41, 0x42, 0x30, 0x46, ...]. Data is not sent to PandwaRF in this form. Internally converted to hex byte array before sending.tx_size
- Not used.async
- true to send in async mode, false to send in sync moderepeat
- number of SW or HW repeat times: 1 = single TX, 2 = 2 TX, etc. If data buffer fits into 1 frame, repeat is handled by FW.
If data buffer is longer than 1 frame, repeat is handled by SW.cb
- Callback to be called with the result of operation, when the background task is terminated.public void txSendHex(byte[] buffer_hex, int tx_size, boolean async, int repeat, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
buffer_hex
- an hex byte array in the form [0xAB, 0x0F, 0x00, 0xFF, ...]. Data can be sent to PandwaRF in this form. No internally conversion before sending.tx_size
- Not used.async
- true to send in async mode, false to send in sync moderepeat
- number of SW or HW repeat times: 1 = single TX, 2 = 2 TX, etc. If data buffer fits into 1 frame, repeat is handled by FW.
If data buffer is longer than 1 frame, repeat is handled by SW.cb
- Callback to be called with the result of operation, when the background task is terminated.public int rxSetup(int frequency, int modulation, int dataRate, int frameLength, int chanbw, int deviation)
frequency
- The frequency to use, in Hz.modulation
- The modulation value to use. Cf. Common.getModulationValue(String)
for possible valuesdataRate
- Sampling rate, in HzframeLength
- Size (in bytes) of the packet that the CC1111 transceiver needs to capture before sending it to Androidchanbw
- Receiver Channel Filter Bandwidth, in Hz.deviation
- Channel deviation, in Hz. Only used for 2-FSK/GFSK/MSK.Common.getModulationValue(String)
public void rxSetup(int frequency, int modulation, int dataRate, int frameLength, int chanbw, int deviation, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
frequency
- The frequency to use, in Hz.modulation
- The modulation value to use. Cf. Common.getModulationValue(String)
for possible valuesdataRate
- Sampling rate, in HzframeLength
- Size (in bytes) of the packet that the CC1111 transceiver needs to capture before sending it to Androidchanbw
- Receiver Channel Filter Bandwidth in Hzdeviation
- Channel deviation, in Hz. Only used for 2-FSK/GFSK/MSK.cb
- Callback to be called with the result of operation, when the background task is terminated.Common.getModulationValue(String)
public int rxListen(byte[] buffer, int rx_size)
buffer
- Empty RX data buffer where data will be stored.rx_size
- Size of RX data buffer.public void rxListen(byte[] buffer, int rx_size, GollumCallbackGetInteger cb)
rxSetup(int, int, int, int, int, int)
It creates a background task so do not call from background task.
Must NOT be called from background thread, as this method already creates its own AsyncTask.
buffer
- Empty RX data buffer where data will be stored.rx_size
- Size of RX data buffer.cb
- Callback to be called with the result of operation, when the background task is terminated.public int rxStop()
public void rxStop(GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
cb
- Callback to be called with the result of operation, when the background task is terminated.public int rxDataRateMeasStart(int frequency, int modulation, int dataRate, int chanbw, int deviation, int threshold_occ_winner)
frequency
- The frequency to use, in Hz.modulation
- The modulation value to use. Cf. Common.getModulationValue(String)
for possible valuesdataRate
- Sampling rate, in Hz.chanbw
- Receiver Channel Filter Bandwidth, in Hz. If 0: calculates the optimal ChanBW setting for the current freq/baud.deviation
- Channel deviation, in Hz. Only used for 2-FSK/GFSK/MSK.threshold_occ_winner
- Number of occurence needed for a duration to be elected as the winner.Common.getModulationValue(String)
public int rxDataRateMeasStop()
public int rxDataRateMeasListen()
public int keeloq_enc(byte[] key, byte[] plaintext, GollumCallbackGetByteArray cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
key
- Keeloq device key.plaintext
- Data to encrypt.cb
- Callback to be called with the result of operation, when the background task is terminated.public int keeloq_dec(byte[] key, byte[] ciphertext, GollumCallbackGetByteArray cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
key
- Keeloq device key.ciphertext
- Data to decrypt.cb
- Callback to be called with the result of operation, when the background task is terminated.public void saveButtonConfigInFlash(int button, int frequency, int modulation, int dataRate, int repeat, byte[] buffer, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
button
- Id of the button. Range [1, 4].frequency
- The frequency to use, in Hz.modulation
- The modulation value to use. Cf. Common.getModulationValue(String)
for possible valuesdataRate
- Transmission data rate, in bits/s.repeat
- number of SW or HW repeat times: 1 = single TX, 2 = 2 TX, etc. If data buffer fits into 1 frame, repeat is handled by FW.
If data buffer is longer than 1 frame, repeat is handled by SW.buffer
- Data to be transmitted when button is pushed.cb
- Callback to be called with the result of operation, when the background task is terminated.Common.getModulationValue(String)
public void execButton(int button, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
button
- Id of the button. Range [1, 4].cb
- Callback to be called with the result of operation, when the background task is terminated.public boolean isDongleModeBootloader()
public boolean isDongleModeFirmware()
public void isDongleModeBootloader(GollumCallbackGetBoolean cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
Use isDongleModeBootloader()
instead if calling from background task already
cb
- Callback to be called with the result of operation, when the background task is terminated.public void isDongleModeFirmware(GollumCallbackGetBoolean cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
Use isDongleModeFirmware()
instead if calling from background task already
cb
- Callback to be called with the result of operation, when the background task is terminated.public void getRfTestList(byte[] rfTestList, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
rfTestList
- Array to store the available RF test list.cb
- Callback to be called with the result of operation, when the background task is terminated.public void runRfTest(int test, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
test
- Number of test to runcb
- Callback to be called with the result of operation, when the background task is terminated.public void getNativeLibVersion(GollumCallbackGetString cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
cb
- Callback to be called with the result of operation, when the background task is terminated.public void getNativeLibusbVersion(GollumCallbackGetString cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
cb
- Callback to be called with the result of operation, when the background task is terminated.public void setNativeNpiTimeout(int syncDhBleTimeOutMs, int syncDhUsbTimeOutMs, int rxThreadTimeoutMs, GollumCallbackGetInteger cb)
syncDhBleTimeOutMs
- Timeout value for Gollum Native Stack when connected in BLE.syncDhUsbTimeOutMs
- Timeout value for Gollum Native Stack when connected in USB.rxThreadTimeoutMs
- Timeout value for Gollum Native Stack when looking for an asynchronous message in NPI queue.cb
- Callback to be called with the result of operation, when the background task is terminated.public void setNativeNpiTimeout(NpiParameters npiParams, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
npiParams
- Set of timeout values for Gollum Native Stack.cb
- Callback to be called with the result of operation, when the background task is terminated.public void setNativeNpiTimeout(java.lang.String timeoutStr, GollumCallbackGetInteger cb)
timeoutStr
- NPI timeout policy value. Can be one of ["short", "medium", "long"]cb
- Callback to be called with the result of operation, when the background task is terminated.public NpiParameters getNpiParameters()
NpiParameters
public void getCc1111RfRegisters(GollumCallbackGetMap<java.lang.String,java.lang.Byte> cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
cb
- Callback to be called with the result of operation, when the background task is terminated.public void setCC1111RfRegisters(byte[] registerBuffer, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
registerBuffer
- Buffer where CC1111 registers values will be stored.cb
- Callback to be called with the result of operation, when the background task is terminated.public void pingInContext()
public void ping(GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
cb
- Callback to be called with the result of operation, when the background task is terminated.public void getJavaScriptLibVersions(GollumCallbackGetString cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
cb
- Callback to be called with the result of operation, when the background task is terminated.public int registerRead(int address, byte[] buffer, int bufLen)
address
- Address of first CC1111 register to read.buffer
- Buffer where CC1111 registers values will be stored.bufLen
- Number of registers to read consecutively.public void registerRead(int address, byte[] buffer, int bufLen, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
address
- Address of first CC1111 register to read.buffer
- Buffer where CC1111 registers values will be stored.bufLen
- Number of registers to read consecutively.cb
- Callback to be called with the result of operation, when the background task is terminated.public int registerWrite(int address, byte[] buffer, int bufLen)
address
- Address of first CC1111 register to write.buffer
- Buffer of data to write to CC1111 registers.bufLen
- Number of registers to write consecutively.public void registerWrite(int address, byte[] buffer, int bufLen, GollumCallbackGetInteger cb)
Must NOT be called from background thread, as this method already creates its own AsyncTask.
address
- Address of first CC1111 register to write.buffer
- Buffer of data to write to CC1111 registers.bufLen
- Number of registers to write consecutively.cb
- Callback to be called with the result of operation, when the background task is terminated.public void setDongleBusyState(java.lang.Boolean busy, Common.RfTask rfTask)
busy
- State to be forced into. True: busy, false: free.rfTask
- Task that should be broadcast notified as free/busy.public void forceResetDongleBusyState(java.lang.Boolean state)
state
- State to be forced into. True: busy, false: free.public HandleFirmwareCC1111 getHandleFirmwareCC1111()
public HandleFirmwareNordic getHandleFirmwareNordic()
public boolean isAutoBleReconnectIfError()
public void setAutoBleReconnectIfError(boolean autoBleReconnectIfError)
autoBleReconnectIfError
- If true, allow automatic BLE reconnection in case of BLE disconnection (GATT error, ...)public void logStatisticEvent(java.lang.String eventName, java.lang.String param)
eventName
- Backend statistic event name.param
- Associated parameters.public void logStatisticEvent(java.lang.String eventName, int param)
eventName
- Backend statistic event name.param
- Associated parameters.public void forceCrashReport()