forked from atlas0fd00m/rfcat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrfcat
More file actions
executable file
·47 lines (33 loc) · 1.33 KB
/
Copy pathrfcat
File metadata and controls
executable file
·47 lines (33 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
import sys
import readline
import rlcompleter
readline.parse_and_bind("tab: complete")
from rflib import *
intro = """'RfCat, the greatest thing since Frequency Hopping!'
Don't you wish this were a CLI!? Sorry. Maybe soon...
For now, enjoy the raw power of rflib, or write your own device-specific CLI!
currently your environment has an object called "d" for dongle. this is how
you interact with the rfcat dongle, for :
>>> d.ping()
>>> d.setFreq(433000000)
>>> d.setMdmModulation(MOD_ASK_OOK)
>>> d.makePktFLEN(250)
>>> d.RFxmit("HALLO")
>>> d.RFrecv()
>>> print d.reprRadioConfig()
"""
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--research', default=False, action="store_true", help='Interactive Python and the "d" instance to talk to your dongle. melikey longtime.')
parser.add_argument('-i', '--index', default=0, type=int)
parser.add_argument('-s', '--specan', default=False, action="store_true", help='start spectrum analyzer')
ifo = parser.parse_args()
if ifo.research:
interactive(ifo.index, DongleClass=RfCat, intro=intro)
else:
# do the full-rfcat thing
d = RfCat(ifo.index)
d.rf_configure(**ifo.__dict__)
d.rf_redirection((sys.stdin, sys.stdout))