-
Notifications
You must be signed in to change notification settings - Fork 53
Developer JavaScript Functions Mapping
JavaScript Function | Description |
---|---|
[[ gollumRfSetRfConfigPredefined | Developer-JavaScript-Functions-Mapping#gollumrfsetrfconfigpredefined]] |
[[ gollumRfSetupConfig | Developer-JavaScript-Functions-Mapping#gollumrfsetupconfig]] |
[[ gollumRfInitDongle | Developer-JavaScript-Functions-Mapping#gollumrfinitdongle]] |
JavaScript Function | Description |
---|---|
[[ gollumRfSetFrequency | Developer-JavaScript-Functions-Mapping#gollumrfsetfrequency]] |
[[ gollumRfSetOutputPower | Developer-JavaScript-Functions-Mapping#gollumrfsetoutputpower]] |
[[ gollumRfSetBitRate | Developer-JavaScript-Functions-Mapping#gollumrfsetbitrate]] |
[[ gollumRfSetModulation | Developer-JavaScript-Functions-Mapping#gollumrfsetmodulation]] |
[[ gollumRfSetFilterBandwidth | Developer-JavaScript-Functions-Mapping#gollumrfsetfilterbandwidth]] |
[[ gollumRfSetMaxPower | Developer-JavaScript-Functions-Mapping#gollumrfsetmaxpower]] |
JavaScript Function | Description |
---|---|
[[ gollumRfTxFlush | Developer-JavaScript-Functions-Mapping#gollumrftxflush]] |
[[ gollumRfTxSetup | Developer-JavaScript-Functions-Mapping#gollumrftxsetup]] |
[[ gollumRfSend0 | Developer-JavaScript-Functions-Mapping#gollumrfsend0]] |
[[ gollumRfSend1 | Developer-JavaScript-Functions-Mapping#gollumrfsend1]] |
[[ gollumRfSendByte | Developer-JavaScript-Functions-Mapping#gollumrfsendbyte]] |
[[ gollumRfSendStream | Developer-JavaScript-Functions-Mapping#gollumrfsendstream]] |
[[ gollumRfTxSend | Developer-JavaScript-Functions-Mapping#gollumrftxsend]] |
[[ gollumRfXmitAsync | Developer-JavaScript-Functions-Mapping#gollumrfxmitasync]] |
[[ gollumRfStartRfJamming | Developer-JavaScript-Functions-Mapping#gollumrfstartrfjamming]] |
[[ gollumRfStopRfJamming | Developer-JavaScript-Functions-Mapping#gollumrfstoprfjamming]] |
JavaScript Function | Description |
---|---|
[[ gollumRfRxSetup | Developer-JavaScript-Functions-Mapping#gollumrfrxsetup]] |
[[ gollumRfRxListen | Developer-JavaScript-Functions-Mapping#gollumrfrxlisten]] |
[[ gollumRfRxStop | Developer-JavaScript-Functions-Mapping#gollumrfrxstop]] |
JavaScript Function | Description |
---|---|
[[ gollumGetCC1111RfRegisters | Developer-JavaScript-Functions-Mapping#gollumgetcc1111rfregisters]] |
[[ gollumRfRegisterRead | Developer-JavaScript-Functions-Mapping#gollumrfregisterread]] |
[[ gollumRfRegisterWrite | Developer-JavaScript-Functions-Mapping#gollumrfregisterwrite]] |
[[ gollumRfCC1111Sleep | Developer-JavaScript-Functions-Mapping#gollumrfcc1111sleep]] |
[[ gollumRfGetBuildType | Developer-JavaScript-Functions-Mapping#gollumrfgetbuildtype]] |
[[ gollumRfResetRadioChip | Developer-JavaScript-Functions-Mapping#gollumrfresetradiochip]] |
JavaScript Function | Description |
---|---|
[[ gollumRfSetLed | Developer-JavaScript-Functions-Mapping#gollumrfsetled]] |
[[ gollumRfPing | Developer-JavaScript-Functions-Mapping#gollumrfping]] |
[[ gollumPrint | Developer-JavaScript-Functions-Mapping#gollumprint]] |
[[ gollumRfDelay | Developer-JavaScript-Functions-Mapping#gollumrfdelay]] |
[[ gollumRfSleep | Developer-JavaScript-Functions-Mapping#gollumrfsleep]] |
SW reset of CC1111
Parameter | Type | Role |
---|---|---|
None | - | - |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfResetRadioChip();
Sets the TX/RX frequency of CC1111
Parameters | Type | Role |
---|---|---|
freq | unsigned int | Frequency in Hz |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfSetFrequency(435000000);
Programs the full list of RF parameter in 1 step, using a predefined RF configuration. TODO: add predefined RF configuration details
Parameters | Type | Role |
---|---|---|
configId | unsigned int | Id of the predefined RF configuration to use |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfSetRfConfigPredefined(0);
Sets the CC1111 'standard' output power For more complex power shaping this will need to be done manually.
Parameters | Type | Role |
---|---|---|
power | unsigned int | Output power as defined in table below |
Output Power (dBm) | 315 MHz | 433 MHz | 868 MHz | 915 MHz |
---|---|---|---|---|
–30 | 0x12 | 0x12 | 0x03 | 0x03 |
–20 | 0x0D | 0x0E | 0x0E | 0x0D |
–15 | 0x1C | 0x1D | 0x1E | 0x1D |
–10 | 0x34 | 0x34 | 0x27 | 0x26 |
–5 | 0x2B | 0x2C | 0x8F | 0x57 |
0 | 0x51 | 0x60 | 0x50 | 0x8E |
5 | 0x85 | 0x84 | 0x84 | 0x83 |
7 | 0xCB | 0xC8 | 0xCB | 0xC7 |
10 | 0xC2 | 0xC0 | 0xC2 | 0xC0 |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfSetFrequency(433000000);
gollumRfSetOutputPower(0x60); // Sets output power to 0dBm
Sets the CC1111 Data Rate
Parameters | Type | Role |
---|---|---|
datarate | unsigned int | Data rate in bits/s |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfSetBitRate(2500);
Sets the CC1111 Modulation
Parameters | Type | Role |
---|---|---|
mod | unsigned int | Modulation value |
Modulation | Value |
---|---|
MOD_2FSK | 0x00 |
MOD_4FSK | 0x40 |
MOD_GFSK | 0x10 |
MOD_ASK_OOK | 0x30 |
MOD_MSK | 0x70 |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
//MOD_2FSK = 0x00
//MOD_4FSK = 0x40
//MOD_GFSK = 0x10
//MOD_ASK_OOK = 0x30
//MOD_MSK = 0x70
gollumRfSetModulation(0x30);
Sets the CC1111 RX filter bandwidth
Parameters | Type | Role |
---|---|---|
bandwidth | unsigned int (32 bits) | Bandwidth, in Hz, min 53571 max 812500 |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfSetFilterBandwidth(100000);
Sends a data 0
Parameters | Type | Role |
---|---|---|
duration | int | duration of the data (us) |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
Sends a data 1
Parameters | Type | Role |
---|---|---|
duration | int | duration of the data (us) |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
Sends a data byte
Parameters | Type | Role |
---|---|---|
data | unsigned char | byte to transmit |
duration_us | unsigned int | byte duration |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
Sends an array of data to the CC11xx WARNING: Data is directly sent without conversion.
Parameters | Type | Role |
---|---|---|
data | Array of unsigned char | Array of data to send |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfSendStream("test");
gollumRfSendStream([ 0x80, 0x00, 0x00, 0x00 ]);
Disabled
Parameters | Type | Role |
---|---|---|
delay | unsigned int | duration of the delay (us) |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfDelay(100);
Flushes the TX FIFO
Parameter | Type | Role |
---|---|---|
None | - | - |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfTxFlush();
Sets the led
Parameters | Type | Role |
---|---|---|
led_id | ZZZ | id of led |
value | ddd | value that we will set. 0: OFF, 1: ON |
Eye | LED id | Color |
Right | 2 | Orange LED |
Right | 4 | Blue LED |
Left | 1 | Green LED |
Left | 3 | Red LED |
Cf Hardware LEDs Indication State for more details about LEDs.
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfSetLed(2, 1); // Set LED 2 to ON
Sends a sleep command to the CC1111
Parameters | Type | Role |
---|---|---|
pm | uint16_t | C1111 Power Management mode of the sleep (between 0 and 3) |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfCC1111Sleep(3); // Enters PM mode 3
Return the build type of the dongle
Parameter | Type | Role |
---|---|---|
None | - | - |
Return value | Type | Role |
---|---|---|
BuildType | String | build type of the dongle |
Usage:
gollumPrint("Build type is: " + gollumRfGetBuildType());
Sends a ping in order to get an alive response
Parameter | Type | Role |
---|---|---|
None | - | - |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfPing();
Prints a string to the output console
Parameters | Type | Role |
---|---|---|
str | String | string to print on the console of the smartphone |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
var a = gollumRfGetBuildType();
gollumPrint("Build version is: " + a);
Stops RX data reception
Parameter | Type | Role |
---|---|---|
None | - | - |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfRxStop();
Configures PandwaRF for data reception
Parameters | Type | Role |
---|---|---|
freq | uint32_t | frequence |
modulation | uint8_t | modulation. Cf [[ gollumRfSetModulation |
drate | uint32_t | Data rate |
flen | uint8_t | frame length |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfRxSetup(433913879, 0, 3200, 50);
Send Tx message over radio interface
Parameters | Type | Role |
---|---|---|
data | String | buffer containing data to Transmit |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
var string = "\x88\x8e\x88";
var size = 20;
var freq = 433920000;
var mod = 0x30;
var drate = 3200;
gollumRfTxSetup(freq, mod, drate);
gollumRfTxSend("" + string);
Returns the names and values of cc1111 registers
Parameter | Type | Role |
---|---|---|
None | - | - |
Return value | Type | Role |
---|---|---|
data[0] | String[] | Register Names |
data[1] | String[] | Register Values |
Usage:
var values, names, i;
var res = gollumGetCC1111RfRegisters();
names = res[0];
values = res[1];
for (i = 0; i < names.length; i++) {
gollumPrint("" + names[i] + " - " + values[i]);
}
Read the radio registers starting at addr (first setting RF state to IDLE, then returning to RX/TX)
Parameters | Type | Role |
---|---|---|
addr | uint16_t | register start address |
length | uint16_t | number of register to read |
Return value | Type | Role |
---|---|---|
Object array | Object array | object containing the data read |
Usage:
var s = gollumRfRegisterRead(0xDF01, 5); // we start to read registers a "0xDF01",
// and we finally read 5 registers
var i;
for(i = 0; i < s.length; i++){
gollumPrint("Value read - "+ s[i].toString(16));
}
Set the radio register 'addr' to 'data' (first setting RF state to IDLE, then returning to RX/TX)
Parameters | Type | Role |
---|---|---|
data | String | register value to write(array of bytes) |
addr | uint16_t | register address |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumPrint("---------- Before writting registers --------- ");
var before =
gollumRfRegisterRead(0xDF01, 5); // we start to read registers a "0xDF01",
// and we finally read 5 registers
for (var z = 0; z < before.length; z++) {
gollumPrint("Value read - " + before[z].toString(16));
}
var values = [ 0xAB, 0xEF, 0xFF ]; // values in hexa
gollumRfRegisterWrite(values, 0xDF01); // we start to write a value at
// register which has address "0xDF01",
// We write in 3 registers
gollumPrint("---------- After writting registers --------- ");
var after =
gollumRfRegisterRead(0xDF01, 5); // we start to read registers a "0xDF01",
// and we finally read 5 registers
for (var i = 0; i < after.length; i++) {
gollumPrint("Value read - " + after[i].toString(16));
}
Config radio before sending Tx message over radio interface
Parameters | Type | Role |
---|---|---|
freq | uint32_t | frequence |
modulation | uint8_t | modulation. Cf [[ gollumRfSetModulation |
drate | uint32_t | Data rate |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfTxSetup(433913879, 0, 3200); // Transmit on 433MHz at 3200 bits/s using 2-FSK modulation
Allocates memory, and fills the given buffer with radio data
Parameters | Type | Role |
---|---|---|
bufsize | int | size to allocate to the buffer |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
data = gollumRfRxListen(100); // 100 is the size to allocate to the RX buffer
Initialization of Gollum Native Library CC1111 configuration structure. Used before other PandwaRF JS functions to query the state of CC1111 HW registers and cache it internally. This shall speed up subsequent CC1111 HW registers. However, it can be omitted. If used, shall be done before dongle initialization.
Optional.
Parameter | Type | Role |
---|---|---|
None | - | - |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfSetupConfig();
gollumRfInitDongle();
gollumRfSetModulation(mod, invert);
Dongle initialization functions.
If used, shall be done after CC1111 configuration structure initialization (gollumRfSetupConfig).
It is equivalent to:
- gollumRfSetFrequency(433920000)
- SetMdmSyncMode(CS carrier-sense above threshold)
- SetMdmSyncWord()
- SetPktPQT(0)
- MakePktFlen(250 bytes)
- SetPktDataWhitening(Disabled)
- SetMdmFEC(Disabled)
- SetPktCRC(Disabled)
- SetRxSensitivity(Default)
- SetRxFilterBW(Default)
Optional.
Parameter | Type | Role |
---|---|---|
None | - | - |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfSetupConfig();
gollumRfInitDongle();
gollumRfSetModulation(mod, invert);
Sets the CC1111 max transmit power
Parameters | Type | Role |
---|---|---|
maxpower | uint8_t | Max TX power value. Cf. [[ gollumRfSetOutputPower |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfSetMaxPower(0x0E); // Max TX power is -20dBm
Sends Asynchronous data over RF interface
Parameters | Type | Role |
---|---|---|
data_buffer | String | EEEE |
repeat | uint16_t | number of repeat times, CC1111 RF firmware handles repeatition |
offset | uint16_t | repeat from byte number |
delay | uint16_t | 'millis' delay between each send |
transmit_times | uint16_t | umber of repeated sends inside this function |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
var word = "\xB2\xCB\x2C\xB2\xC8\x00\x00\x00\x00";
gollumRfSetupConfig();
gollumRfInitDongle();
gollumRfSetModulation(mod, invert);
gollumRfSetBitRate(rate);
gollumRfSetMaxPower(0);
gollumRfXmitAsync(word, 10, 0, 0, 1);
Pause the script execution during x microseconds
Parameters | Type | Role |
---|---|---|
duration_us | uint32_t | duration to sleep |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
gollumRfSleep(1000 * 1000); // Sleep for 1s
Sends a single msg to start frequency jamming
Parameters | Type | Role |
---|---|---|
baseFreq | uint32_t | Base frequency in Hz |
datarate | uint32_t | Data rate for TX in Hz |
mod | uint16_t | Modulation |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
var baseFreq = 434000000;
var rate = 25449;
var mod = 0x30;
gollumPrint("-- Start RF jamming --");
gollumRfStartRfJamming(baseFreq, rate, mod);
gollumRfSleep(6000000); // in microseconds
gollumRfStopRfJamming();
gollumPrint("-- Stop RF jamming --");
Sends a single msg to stop frequency jamming
Parameter | Type | Role |
---|---|---|
None | - | - |
Return value | Type | Role |
---|---|---|
None | - | - |
Usage:
var baseFreq = 434000000;
var rate = 25449;
var mod = 0x30;
gollumPrint("-- Start RF jamming --");
gollumRfStartRfJamming(baseFreq, rate, mod);
gollumRfSleep(6000000); // in microseconds
gollumRfStopRfJamming();
gollumPrint("-- Stop RF jamming --");
Questions or need help? Get in touch or open an Issue!
Project Information
- PandwaRF Home
- General Overview
- Technical Overview
- Possible Applications
- Development Status
- Requirements
PandwaRF Android Application (Normal Mode)
- Quick Start
- Navigation
- Navigation on Tablet
- Android Permissions
- Activity states
- Kaiju account connection
- Kaiju delete account
- Scan
- Bus Service
- Rx/Tx
- Kaiju Analysis
- Rolling code analysis & generation
- Rx Data Rate Measurement
- Spectrum Analyzer
- RF Power Amplifiers
- RF Brute Force
- RF Brute Force Tutorial
- RF Brute Force Session Import Tutorial
- RF Brute Force De Bruijn
- Protocols
- Jamming
- JavaScript
- FW Update
- Dev Mode
- USB Connection
- Pairing/Bonding
- Keeloq Secure Decrypt
- Get PandwaRF Gov App
PandwaRF Android Application (Dev Mode)
- BLE Perf measurement
- CC1111 RF registers direct access
- BLE Errors
- Bus Service Extended
- BLE Parameters
Marauder Android Application
iOS Application
Linux
Hardware
- Architecture
- Power Management
- Buttons
- LEDs Indication States
- Schematics
- Programming
- Battery
- Antennas
- PandwaRF Bare Settings
- FW releases Nordic
- FW releases CC1111
For developers
- Scripting with JavaScript
- JavaScript Functions Mapping
- Scripting with Python
- BLE Services & Characteristics
- CC1111 RfCat Commands
- PandwaRF Android SDK
- PandwaRF Android API
- RX Data Post Rest API
- Software and available applications
Support
- User Guides
- FAQ
- Tested Devices
- Known Issues
- BLE connection issues
- How to clear secure pairing
- How to report an issue
- PandwaRF test procedure
- Recovery mode
- PandwaRF Device Bounty
- Product return information
- Discord Server
- Forum (legacy)
- Chat (legacy)
- Privacy Policy
- Terms & Conditions
Gimme moar!