Interface GollumJSInterface
-
- All Implemented Interfaces:
public interface GollumJSInterface
GollumJSInterface is the interface used by GollumJS for the binding of JS/Java methods
-
-
Method Summary
Modifier and Type Method Description abstract Array<String>
functionList()
abstract void
rfOpen()
Open RF link abstract void
rfClose()
Close RF link abstract void
resetRadioChip()
Order the CC1111 chip to do a power off/power on sequence of the CC1111 using RESET abstract void
setFrequency(int frequency)
Set the RX/TX operating frequency of PandwaRF. abstract int
rxStop()
Stop RX data reception abstract int
rxSetup(int freq, int mod, int drate, int flen, int chanbw, int deviation)
Configure Dongle for RX abstract int
rxListen(int rx_size)
Start listening for RX data abstract int
rxListenAsync(Array<int> buffer)
Fill given list of int where a couple of two int represents a duration. abstract int
txFlush()
Removes all TX messages already in queue abstract int
txSetup(int freq, int mod, int drate, int deviation)
Configure CC1111 radio before sending Tx message over radio interface abstract int
txSend(String buffer, boolean async, int repeat)
Send data as a byte array in the form [0x41, 0x42, 0x30, 0x46, ... abstract int
registerRead(int address, String buffer)
Read a register from CC1111 RF abstract int
registerWrite(int address, String buffer)
Write to a register in CC1111 RF abstract int
startSpecan(int basefreq, int chanspc, int numchan, int pkt_delay_ms)
Starts Spectrum Analyzer abstract int
stopSpecan()
Stop Spectrum Analyzer abstract String
getSpecanRssi(int size)
Returns SpecAn RSSI measurements abstract int
startDataRateMeas(int freq, int mod, int drate, int chanbw, int deviation, int threshold_occ_winner)
Measure data rate abstract int
stopDataRateMeas()
Stop data rate measurement abstract int
listenDataRateMeas()
Periodicaly read for data rate measurement results abstract String
pingSyncEmpty()
Make an empty Synchronous (wait for PandwaRF ack) ping to device abstract String
pingSync(String buffer_hex)
Make a Synchronous (wait for PandwaRF ack) ping with provided data to device abstract Array<int>
getBruteForceStatusUpdate()
Returns Brute Force status update value abstract void
setConfigPredefined(int config)
Set predefined configuration abstract void
setOutputPower(int power_dbm)
Sets 'standard' output power of CC1111 abstract void
setBitRate(int dataRate)
Set the TX/RX data rate to use for PandwaRF transmission/reception abstract void
setModulation(int modulation)
Set the RX/TX operating modulation of PandwaRF. abstract void
setFilterBandwidth(int filter_bandwidth)
Set filter bandwidth abstract void
setLed(int led, boolean val)
Set the specified LED ID on or off abstract void
setCC1111Sleep(int mode)
Put CC1111 into sleep mode abstract String
getBuildType()
Get CC1111 FW build type Sync version (GollumRfBigRogueCCtl, GollumRfBigCCtl, ... abstract Array<String>
getCC1111RfRegisters()
Return the list of CC1111 registers in a String[] list abstract void
startJamming(int startFrequency, int stopFrequency, int dataRate, int modulation)
Start RF jamming Warning: calling this method causes the CC1111 to reset, in order to start Jamming with clean parameters. abstract void
stopJamming()
Stop RF jamming abstract void
setSpecanPktDelay(int pkt_delay_ms)
Configure the delay between 2 Spectrum Analyzer packets abstract void
startBruteForceAttack(int frequency, int dataRate, int modulation, int deviation, int codeLength, int startValue, int stopValue, int repeat, boolean littleEndian, int delay_btw_attempts_ms, int encSymbolZero, int encSymbolOne, int encSymbolTwo, int encSymbolThree, int syncWordSize, String syncWord)
All in one message to start a Brute Force abstract void
stopBruteForceAttack()
Stop the Brute Force attack abstract void
setupBruteForceAttack(int frequency, int dataRate, int modulation, int deviation, int codeLength, int startValue, int stopValue, int repeat, boolean littleEndian, int delay_btw_attempts_ms, int encSymbolZero, int encSymbolOne, int encSymbolTwo, int encSymbolThree, int syncWordSize, String syncWord)
Setup the Brute Force. abstract void
setupLongSymbolBruteForceAttack(int frequency, int dataRate, int modulation, int deviation, int delayBtwAttemptsMs, int symbolLength, String encSymbolZero, String encSymbolOne, String encSymbolTwo, String encSymbolThree)
Setup the Brute Force with long symbols Requires a Brute Force Start SyncCodeTail to start the BF Warning: calling this method causes the CC1111 to reset, in order to start BF with clean parameters. abstract void
setupBruteForceAttackFunction(String functionMask, String functionValue)
Brute Force setup of the Function Mask and Value. abstract void
startBruteForceAttackSyncCodeTail(int syncWordSize, String syncWord, int codeLength, int startValue, int stopValue, int repeat, boolean littleEndian, int tailWordSize, String tailWord)
Start a Brute Force using previous parameters set in Setup Brute Force message Requires a call to rfBruteForceAttackSetup() before abstract void
setTxRxPowerAmp(int actionToPerform)
Set power Amplifiers mode abstract int
getTxRxPowerAmp()
Get power Amplifiers mode abstract void
print(String somethingToPrint)
Print into JS fragment console abstract void
delay(int delayMs)
Causes the currently executing thread to sleep for the specified number of milliseconds abstract String
getCurrentBleDeviceMacAddress()
Returns the current BLE device MAC address abstract int
getCurrentTrxMode()
Returns the current trx mode (USB or BLE) abstract int
setTxInfiniteMode(boolean infiniteMode, int infModeLength)
Configure RF TX infinite mode (for RF air gap-less transmission). abstract int
txSendCompress(String data, boolean async, int repeat, boolean compress)
Send an hexadecimal String. abstract boolean
writeResetNordic()
abstract boolean
writeResetCC1111()
abstract void
notifyProgress(String message, int stepNumber, int countOfSteps)
Update progress -
-
Method Detail
-
functionList
abstract Array<String> functionList()
-
rfOpen
abstract void rfOpen()
Open RF link
-
rfClose
abstract void rfClose()
Close RF link
-
resetRadioChip
abstract void resetRadioChip()
Order the CC1111 chip to do a power off/power on sequence of the CC1111 using RESET
-
setFrequency
abstract void setFrequency(int frequency)
Set the RX/TX operating frequency of PandwaRF. Warning: some API calls that require frequency as parameter can override this value.
-
rxStop
abstract int rxStop()
Stop RX data reception
- Returns:
0 if operation successfully completed, -1 in case of error
-
rxSetup
abstract int rxSetup(int freq, int mod, int drate, int flen, int chanbw, int deviation)
Configure Dongle for RX
- Parameters:
freq
- The frequency to use, in Hzmod
- The modulation value to use.drate
- Sampling rate, in Hzflen
- 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.- Returns:
0 if operation successfully completed, -1 in case of error
-
rxListen
abstract int rxListen(int rx_size)
Start listening for RX data
- Parameters:
rx_size
- Size of RX data buffer- Returns:
0 if operation successfully completed, -1 in case of error
-
rxListenAsync
abstract int rxListenAsync(Array<int> buffer)
Fill given list of int where a couple of two int represents a duration. [lower int0, higher int0, lower int1, higher int1, ...] int range -> [0, 255] in this example, first duration is represented by lower_int0 higher_int0 in little endian.
-
txFlush
abstract int txFlush()
Removes all TX messages already in queue
- Returns:
0 if operation successfully completed, -1 in case of error
-
txSetup
abstract int txSetup(int freq, int mod, int drate, int deviation)
Configure CC1111 radio before sending Tx message over radio interface
- Parameters:
freq
- The frequency to use, in Hzmod
- The modulation value to use.drate
- Transmission data rate, in bits/sdeviation
- Channel deviation, in Hz.- Returns:
0 if operation successfully completed, -1 in case of error
-
txSend
abstract int txSend(String buffer, boolean async, int repeat)
Send data as a byte array in the form [0x41, 0x42, 0x30, 0x46, ...]
- Parameters:
buffer
- as a byte array in the form [0x41, 0x42, 0x30, 0x46, ...].async
- true to send in async mode (doesn't wait for ack from PandwaRF), false to send in sync mode (wait for PandwaRF ack)repeat
- number of SW or HW repeat times: 1 = single TX, 2 = 2 TX, etc.- Returns:
0 if operation successfully completed, -1 in case of error
-
registerRead
abstract int registerRead(int address, String buffer)
Read a register from CC1111 RF
- Parameters:
address
- Address of first CC1111 register to readbuffer
- Buffer where CC1111 registers values will be stored- Returns:
0 if operation successfully completed, -1 in case of error
-
registerWrite
abstract int registerWrite(int address, String buffer)
Write to a register in CC1111 RF
- Parameters:
address
- Address of first CC1111 register to writebuffer
- Buffer of data to write to CC1111 registers- Returns:
0 if operation successfully completed, -1 in case of error
-
startSpecan
abstract int startSpecan(int basefreq, int chanspc, int numchan, int pkt_delay_ms)
Starts Spectrum Analyzer
- Parameters:
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 packets- Returns:
0 if operation successfully completed, -1 in case of error
-
stopSpecan
abstract int stopSpecan()
Stop Spectrum Analyzer
- Returns:
0 if operation successfully completed, -1 in case of error
-
getSpecanRssi
abstract String getSpecanRssi(int size)
Returns SpecAn RSSI measurements
- Parameters:
size
- RSSI Buffer size.- Returns:
String with the RSSI values as an hexadecimal String
-
startDataRateMeas
abstract int startDataRateMeas(int freq, int mod, int drate, int chanbw, int deviation, int threshold_occ_winner)
Measure data rate
- Parameters:
freq
- The frequency to use, in Hzmod
- The modulation value to use.drate
- Sampling rate, in Hzchanbw
- Receiver Channel Filter Bandwidth, in Hz.deviation
- Channel deviation, in Hz.threshold_occ_winner
- Number of occurence needed for a duration to be elected as the winner- Returns:
0 if operation successfully completed, -1 in case of error
-
stopDataRateMeas
abstract int stopDataRateMeas()
Stop data rate measurement
- Returns:
0 if operation successfully completed, -1 in case of error
-
listenDataRateMeas
abstract int listenDataRateMeas()
Periodicaly read for data rate measurement results
- Returns:
value of measured data rate if operation successfully completed, 0 if no DRM result found, -1 if DRM measurement is finished
-
pingSyncEmpty
abstract String pingSyncEmpty()
Make an empty Synchronous (wait for PandwaRF ack) ping to device
- Returns:
null if failure, array with bytes if success
-
pingSync
abstract String pingSync(String buffer_hex)
Make a Synchronous (wait for PandwaRF ack) ping with provided data to device
- Parameters:
buffer_hex
- an hex byte array in the form [0xAB, 0x0F, 0x00, 0xFF, ...].- Returns:
null if failure, array with bytes if success
-
getBruteForceStatusUpdate
abstract Array<int> getBruteForceStatusUpdate()
Returns Brute Force status update value
- Returns:
int array with 2 elements.First element indicates the BF status0 -> UNKNOWN1 -> NOT_STARTED2 -> ONGOING3 -> FINISHEDSecond element is brute force index, represented by an integer 32bits.
-
setConfigPredefined
abstract void setConfigPredefined(int config)
Set predefined configuration
- Parameters:
config
- Predefined configuration Id
-
setOutputPower
abstract void setOutputPower(int power_dbm)
Sets 'standard' output power of CC1111
- Parameters:
power_dbm
- TX output power in dBm
-
setBitRate
abstract void setBitRate(int dataRate)
Set the TX/RX data rate to use for PandwaRF transmission/reception
- Parameters:
dataRate
- TX/RX data rate to use for PandwaRF transmission/reception.
-
setModulation
abstract void setModulation(int modulation)
Set the RX/TX operating modulation of PandwaRF. Warning: some API calls that require modulation as parameter can override this value
- Parameters:
modulation
- The modulation value to use.
-
setFilterBandwidth
abstract void setFilterBandwidth(int filter_bandwidth)
Set filter bandwidth
- Parameters:
filter_bandwidth
- Receiver Channel Filter Bandwidth, in Hz.
-
setLed
abstract void setLed(int led, boolean val)
Set the specified LED ID on or off
- Parameters:
led
- LED Id.val
- True for LED on, false for LED off
-
setCC1111Sleep
abstract void setCC1111Sleep(int mode)
Put CC1111 into sleep mode
- Parameters:
mode
- CC1111 power sleep mode.
-
getBuildType
abstract String getBuildType()
Get CC1111 FW build type Sync version (GollumRfBigRogueCCtl, GollumRfBigCCtl, ...)
- Returns:
build_type
-
getCC1111RfRegisters
abstract Array<String> getCC1111RfRegisters()
Return the list of CC1111 registers in a String[] list
- Returns:
CC1111 registers list
-
startJamming
abstract void startJamming(int startFrequency, int stopFrequency, int dataRate, int modulation)
Start RF jamming
Warning: calling this method causes the CC1111 to reset, in order to start Jamming with clean parameters. All RF parameters set prior to this method call will be lost.
- Parameters:
startFrequency
- The start Frequency to use in HzstopFrequency
- The stop Frequency to use in HzdataRate
- Target data rate, in bits/smodulation
- The modulation value to use.
-
stopJamming
abstract void stopJamming()
Stop RF jamming
-
setSpecanPktDelay
abstract void setSpecanPktDelay(int pkt_delay_ms)
Configure the delay between 2 Spectrum Analyzer packets
- Parameters:
pkt_delay_ms
- delay in ms between packets (max 255 ms)
-
startBruteForceAttack
abstract void startBruteForceAttack(int frequency, int dataRate, int modulation, int deviation, int codeLength, int startValue, int stopValue, int repeat, boolean littleEndian, int delay_btw_attempts_ms, int encSymbolZero, int encSymbolOne, int encSymbolTwo, int encSymbolThree, int syncWordSize, String syncWord)
All in one message to start a Brute Force
- Parameters:
frequency
- The frequency to use in HzdataRate
- Target data rate, in bits/smodulation
- The modulation value to use.deviation
- Channel deviation, in Hz.codeLength
- Number of Symbols in CodeWordstartValue
- The start value of Brute Force from where you want to beginstopValue
- The stop value of Brute Force at which you want to stoprepeat
- Frame Repetition.littleEndian
- Endianess.delay_btw_attempts_ms
- Delay between each frame to send.encSymbolZero
- How to encode symbol '0'encSymbolOne
- How to encode symbol '1'encSymbolTwo
- How to encode symbol '2'encSymbolThree
- How to encode symbol '3'syncWordSize
- Synchronisation word size, in bytes.syncWord
- Synchronisation word, in hexadecimal.
-
stopBruteForceAttack
abstract void stopBruteForceAttack()
Stop the Brute Force attack
-
setupBruteForceAttack
abstract void setupBruteForceAttack(int frequency, int dataRate, int modulation, int deviation, int codeLength, int startValue, int stopValue, int repeat, boolean littleEndian, int delay_btw_attempts_ms, int encSymbolZero, int encSymbolOne, int encSymbolTwo, int encSymbolThree, int syncWordSize, String syncWord)
Setup the Brute Force. Requires a Brute Force Start SyncCodeTail to start the BF.
Warning: calling this method causes the CC1111 to reset, in order to start BF with clean parameters. All RF parameters set prior to this method call will be lost.
- Parameters:
frequency
- The frequency to use in HzdataRate
- Target data rate, in bits/smodulation
- The modulation value to use.deviation
- Channel deviation, in Hz.codeLength
- Number of Symbols in CodeWordstartValue
- The start value of Brute Force from where you want to beginstopValue
- The stop value of Brute Force at which you want to stoprepeat
- Frame Repetition.littleEndian
- Endianess.delay_btw_attempts_ms
- Delay between each frame to send.encSymbolZero
- How to encode symbol '0'encSymbolOne
- How to encode symbol '1'encSymbolTwo
- How to encode symbol '2'encSymbolThree
- How to encode symbol '3'syncWordSize
- Synchronisation word size, in bytes.syncWord
- Synchronisation word, in hexadecimal.
-
setupLongSymbolBruteForceAttack
abstract void setupLongSymbolBruteForceAttack(int frequency, int dataRate, int modulation, int deviation, int delayBtwAttemptsMs, int symbolLength, String encSymbolZero, String encSymbolOne, String encSymbolTwo, String encSymbolThree)
Setup the Brute Force with long symbols Requires a Brute Force Start SyncCodeTail to start the BF
Warning: calling this method causes the CC1111 to reset, in order to start BF with clean parameters. All RF parameters set prior to this method call will be lost.
- Parameters:
frequency
- The frequency to use in HzdataRate
- Target data rate, in bits/smodulation
- The modulation value to use.deviation
- Channel deviation, in Hz.delayBtwAttemptsMs
- Delay between each frame to send.symbolLength
- Length of a symbol.encSymbolZero
- How to encode symbol '0'encSymbolOne
- How to encode symbol '1'encSymbolTwo
- How to encode symbol '2'encSymbolThree
- How to encode symbol '3'
-
setupBruteForceAttackFunction
abstract void setupBruteForceAttackFunction(String functionMask, String functionValue)
Brute Force setup of the Function Mask and Value. Optional after a Brute Force Setup and before Brute Force Start SyncCodeTail to start the BF
- Parameters:
functionMask
- This is like a Mask IP Address.functionValue
- This is the "contrary" of functionMask.
-
startBruteForceAttackSyncCodeTail
abstract void startBruteForceAttackSyncCodeTail(int syncWordSize, String syncWord, int codeLength, int startValue, int stopValue, int repeat, boolean littleEndian, int tailWordSize, String tailWord)
Start a Brute Force using previous parameters set in Setup Brute Force message Requires a call to rfBruteForceAttackSetup() before
-
setTxRxPowerAmp
abstract void setTxRxPowerAmp(int actionToPerform)
Set power Amplifiers mode
- Parameters:
actionToPerform
- Power amplifier mode
-
getTxRxPowerAmp
abstract int getTxRxPowerAmp()
Get power Amplifiers mode
- Returns:
Power amplifier mode on success, -1 in case of failure
-
print
abstract void print(String somethingToPrint)
Print into JS fragment console
- Parameters:
somethingToPrint
- message to print into console
-
delay
abstract void delay(int delayMs)
Causes the currently executing thread to sleep for the specified number of milliseconds
- Parameters:
delayMs
- the length of time to sleep in milliseconds
-
getCurrentBleDeviceMacAddress
abstract String getCurrentBleDeviceMacAddress()
Returns the current BLE device MAC address
- Returns:
the device MAC address
-
getCurrentTrxMode
abstract int getCurrentTrxMode()
Returns the current trx mode (USB or BLE)
- Returns:
current trx mode: {@value {@link com.comthings.gollum.api.gollumandroidlib.GollumDongle#GOLLUM_MODE_USB}} or {@value {@link com.comthings.gollum.api.gollumandroidlib.GollumDongle#GOLLUM_MODE_BLE}}
-
setTxInfiniteMode
abstract int setTxInfiniteMode(boolean infiniteMode, int infModeLength)
Configure RF TX infinite mode (for RF air gap-less transmission). Aka TX FIFO enqueue mode, assuming we are already in a background task Must be called from background thread
Only available in Rogue variants
- Parameters:
infiniteMode
- TX FIFO enqueue mode (true: enabled, false: disabled)infModeLength
- Expected block size when entering Infinite mode, in bytes- Returns:
0 if operation successfully completed, -1 in case of error.
-
txSendCompress
abstract int txSendCompress(String data, boolean async, int repeat, boolean compress)
Send an hexadecimal String. Same as txSend, but assuming we are already in a background task Must be called from background thread. Method will block until completion, whether async is true or false. If buffer contains too much data vs what is possible for the device variant (PandwaRF or Rogue), the data will truncated before sending.
- Parameters:
data
- an hexadecimal String in the form "abcdef0123456789".async
- true to send in async mode (doesn't wait for ack from PandwaRF), false to send in sync mode (wait for PandwaRF ack)repeat
- number of SW or HW repeat times: 1 = single TX, 2 = 2 TX, etc.compress
- If false, no compression requested.- Returns:
0 if operation successfully completed, -1 in case of error.
-
writeResetNordic
abstract boolean writeResetNordic()
-
writeResetCC1111
abstract boolean writeResetCC1111()
-
notifyProgress
abstract void notifyProgress(String message, int stepNumber, int countOfSteps)
Update progress
-
-
-
-