GNU Radio - benchmarkTX Code Walk Through
GNU Radio - benchmarkTX Code Walk Through
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pyoverview
Codeexampletotransmitdata. Includerawdataandfiletransmission(canbe selected). PHYLayerpacketisalreadyported.User implementationisstartingfromMAClayer andabove.
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycode
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Makesthepythoncode executablebyexecuting $chmod+x filename.py"
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
GNUPublicLicence(incomment)
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
ImportingNecessaryModules, modulesfromGNUlibrary
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
ImportingNecessaryModules, modulesfromPython
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
ImportingNecessaryModules, modulesfromCurrentDirectory
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Topblockclassforconstructingthe transmitterflowgraph
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
MainFunction
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Sendpacketfunction(local functioninsidemain)
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Modulationinitialization(pointer passingformodulationdata buffer)
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Inputsettingfromuserfor transmitter. Settingbyuserisperformed duringpythonfileexecution. ThisisusingOptionParser class (classprovidedbypython /usr/lib/python2.5/optpasrse.py).
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Includetheoptionselectedby userfortransmitterinthe transmit_path file.
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Parsethecommandline optionfoundinargs. Checkforerrorintheparsing process. Returntwovalue: o Value>option(passing alltheoptionvalue) o args >args (reporton anyerror)
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
benchmark_tx.pycodewalkthrough
Constructingthetransmit flowgraph andpassthepointer toavariablecalledtb.
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Enabletherealtime schedulingforflowgraph tobe abletorun.
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Checkingerrorinthestatusof realtimeschedulingenabling.
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Starttheexecutionofthe constructedflowgraph usingstartmethod. Flowgraph propertiesin includestart,stopandwait.
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Variableinitializationfor packettransmission
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Totalbytetobesend
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Sizeforeachpacket
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Generatepacket(ifrawdata transmissionischosen)
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
benchmark_tx.pycodewalkthrough
sendpackettroughsend_pkt function.
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Tellsendfunctionthatwehave finishedsendingpacket.
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Thisistomakethe flowgraph keeprunning untiluserasktostop. Notethatmainisonlyone thread,theremightbe anotherthreadrunningin theprogram.
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Thisiswherepythoncode willgoatthefirsttime duringtheexecution(after theimportandinclude work). ItislikeamainfunctioninC programming.
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
Mainiscalledbythis command.
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
benchmark_tx.pycodewalkthrough
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds
Q&A
ThankYouforYourAttention
http://trg.fke.utm.my/ InspiringCreative&InnovativeMinds