-
Notifications
You must be signed in to change notification settings - Fork 229
Update GoodFET to resolve packet concatenation and fix the sync problem #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
545ad2c
ebd96c2
bdb9a0e
46feb3c
30b78ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ def setup(self): | |
|
|
||
| #Set up the radio for ZigBee | ||
| self.strobe(0x01); #SXOSCON | ||
| self.strobe(0x01); #SXOSCON ## YL: idk why but needed to enable ram poking | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @travisgoodspeed - this appears that this PR just updates code from GoodFET repo, do you have insight into this change as the comment makes me wonder about it? https://github.com/travisgoodspeed/goodfet/blob/master/client/GoodFETCCSPI.py#L22 |
||
| self.strobe(0x02); #SCAL | ||
| self.poke(0x11, 0x0AC2 & (~0x0800)); #MDMCTRL0, promiscuous | ||
| self.poke(0x12, 0x0500); #MDMCTRL1 | ||
|
|
@@ -76,12 +77,10 @@ def peek(self,reg,bytes=2): | |
| bytes=2; | ||
|
|
||
| self.writecmd(self.CCSPIAPP,0x02,len(data),data); | ||
| try: | ||
| toret=( ord(self.data[2]) + (ord(self.data[1])<<8) ); | ||
| except Exception as e: | ||
| print "issue in peeking for a register" | ||
| print e | ||
| toret=( (ord(self.data[1])<<8) ); | ||
| toret=( | ||
| ord(self.data[2])+ | ||
| (ord(self.data[1])<<8) | ||
| ); | ||
| return toret; | ||
| def poke(self,reg,val,bytes=2): | ||
| """Write a CCSPI Register.""" | ||
|
|
@@ -198,6 +197,20 @@ def pokeram(self,adr,data): | |
| return; | ||
|
|
||
| lastpacket=range(0,0xff); | ||
|
|
||
| def RF_txrxpacket(self,packet,timeout=1): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using this for zbstumbler type use cases may be helpful to get a potentially quicker RX to a forged beacon request? CC @taylorcenters |
||
| data="\0"; | ||
| self.data=data; | ||
| packet = [timeout&0xff, timeout>>8] + packet | ||
|
|
||
| self.writecmd(self.CCSPIAPP,0x86,len(packet),packet); | ||
| buffer=self.data; | ||
| self.lastpacket=buffer; | ||
| if(len(buffer)==0): | ||
| return None; | ||
|
|
||
| return buffer; | ||
|
|
||
| def RF_rxpacket(self): | ||
| """Get a packet from the radio. Returns None if none is | ||
| waiting.""" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| from scapy.base_classes import SetGen | ||
| from scapy.packet import Gen, Raw | ||
| from scapy.all import * | ||
| from scapy import plist | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good fix!
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue already reported and fixed at #207 |
||
| # This line will allow KillerBee's pcap reader to overwrite scapy's reader that is imported on the | ||
| # above line, per suggestion from cutaway at https://code.google.com/p/killerbee/issues/detail?id=28: | ||
| from killerbee import * | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're going to move this to the FAQs if that's OK. @taylorcenters is preparing the update off of this PR that includes that.