12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573 |
- '''
- ubxtool -- u-blox configurator and packet decoder
- usage: ubxtool [OPTIONS] [server[:port[:device]]]
- '''
- from __future__ import absolute_import, print_function, division
- import binascii
- from functools import reduce
- import getopt
- import operator
- import os
- import re
- import socket
- import stat
- import string
- import struct
- import sys
- import time
- PROG_NAME = 'ubxtool'
- try:
- import serial
- except ImportError:
- serial = None
- try:
- import gps
- except ImportError:
-
- sys.stderr.write("%s: failed to import gps, check PYTHONPATH\n" %
- PROG_NAME)
- sys.exit(2)
- gps_version = '@VERSION@'
- if gps.__version__ != gps_version:
- sys.stderr.write("%s: ERROR: need gps module version %s, got %s\n" %
- (PROG_NAME, gps_version, gps.__version__))
- sys.exit(1)
- try:
- struct.unpack_from('B', bytearray(1))
- except TypeError:
- unpack_from_orig = struct.unpack_from
- def unpack_from_fixed(fmt, buf, offset=0):
- return unpack_from_orig(fmt, buffer(buf), offset=offset)
- struct.unpack_from = unpack_from_fixed
- VERB_QUIET = 0
- VERB_NONE = 1
- VERB_DECODE = 2
- VERB_INFO = 3
- VERB_RAW = 4
- VERB_PROG = 5
- opts = {
-
- 'command': None,
-
- 'del_item': [],
-
- 'disable': [],
-
- 'enable': [],
-
- 'help': None,
-
- 'input_file_name': None,
-
- 'get_item': [],
-
- 'input_forced_wait': False,
-
- 'input_speed': 9600,
-
- 'input_wait': 2.0,
-
- 'oaf_name': None,
-
- 'poll': [],
-
- 'port': None,
-
-
-
-
-
-
-
-
-
- 'protver': 10.0,
-
- 'raw_file': None,
-
- 'read_only': False,
-
- 'set_item': [],
-
- 'set_speed': None,
-
- 'target': {"server": None, "port": gps.GPSD_PORT, "device": None},
-
- 'timestamp': 0,
-
- 'verbosity': VERB_NONE,
-
- 'progopts': '',
- }
- def erd_s(erd):
- """convert 6 bits of subframe 4, page 13 (NMCT) ERD to string"""
- if erd & 0x20:
- if erd == 0x20:
- return "n/a"
-
- erd = 1 - erd
-
- return "%3s" % erd
- def unpack_s11(word, pos):
- """Grab a signed 11 bits from offset pos of word"""
- ubytes = bytearray(2)
- ubytes[0] = (word >> pos) & 0xff
- ubytes[1] = (word >> (pos + 8)) & 0x07
- if 0x04 & ubytes[1]:
-
- ubytes[1] |= 0xf8
- u = struct.unpack_from('<h', ubytes, 0)
- return u[0]
- def unpack_s11s(word):
- """Grab the weird split signed 11 bits from word"""
- newword = (word >> 22) & 0xff
- newword <<= 3
- newword |= (word >> 8) & 0x07
- return unpack_s11(newword, 0)
- def unpack_s14(word, pos):
- """Grab a signed 14 bits from offset pos of word"""
- ubytes = bytearray(2)
- ubytes[0] = (word >> pos) & 0xff
- ubytes[1] = (word >> (pos + 8)) & 0x3f
- if 0x20 & ubytes[1]:
-
- ubytes[1] |= 0xc0
- u = struct.unpack_from('<h', ubytes, 0)
- return u[0]
- def unpack_s16(word, pos):
- """Grab a signed two bytes from offset pos of word"""
- ubytes = bytearray(2)
- ubytes[0] = (word >> pos) & 0xff
- ubytes[1] = (word >> (pos + 8)) & 0xff
- u = struct.unpack_from('<h', ubytes, 0)
- return u[0]
- def unpack_u16(word, pos):
- """Grab a unsigned two bytes from offset pos of word"""
- ubytes = bytearray(2)
- ubytes[0] = (word >> pos) & 0xff
- ubytes[1] = (word >> (pos + 8)) & 0xff
- u = struct.unpack_from('<H', ubytes, 0)
- return u[0]
- def unpack_s22(word, pos):
- """Grab a signed 22 bits from offset pos of word"""
- ubytes = bytearray(4)
- ubytes[0] = (word >> pos) & 0xff
- ubytes[1] = (word >> (pos + 8)) & 0xff
- ubytes[2] = (word >> (pos + 16)) & 0x3f
- ubytes[3] = 0
- if 0x20 & ubytes[2]:
-
- ubytes[2] |= 0xc0
- ubytes[3] = 0xff
- u = struct.unpack_from('<l', ubytes, 0)
- return u[0]
- def unpack_s24(word, pos):
- """Grab a signed 24 bits from offset pos of word"""
- ubytes = bytearray(4)
- ubytes[0] = (word >> pos) & 0xff
- ubytes[1] = (word >> (pos + 8)) & 0xff
- ubytes[2] = (word >> (pos + 16)) & 0xff
- ubytes[3] = 0
- if 0x80 & ubytes[2]:
-
- ubytes[3] = 0xff
- u = struct.unpack_from('<l', ubytes, 0)
- return u[0]
- def unpack_u24(word, pos):
- """Grab an unsigned 24 bits from offset pos of word"""
- ubytes = bytearray(4)
- ubytes[0] = (word >> pos) & 0xff
- ubytes[1] = (word >> (pos + 8)) & 0xff
- ubytes[2] = (word >> (pos + 16)) & 0xff
- ubytes[3] = 0
- u = struct.unpack_from('<L', ubytes, 0)
- return u[0]
- def unpack_s32s(word, word1):
- """Grab an signed 32 bits from weird split word, word1"""
- ubytes = bytearray(4)
- ubytes[0] = (word >> 6) & 0xff
- ubytes[1] = (word >> 14) & 0xff
- ubytes[2] = (word >> 22) & 0xff
- ubytes[3] = (word1 >> 6) & 0xff
- u = struct.unpack_from('<l', ubytes, 0)
- return u[0]
- def unpack_u32s(word, word1):
- """Grab an unsigned 32 bits from weird split word, word1"""
- ubytes = bytearray(4)
- ubytes[0] = (word >> 6) & 0xff
- ubytes[1] = (word >> 14) & 0xff
- ubytes[2] = (word >> 22) & 0xff
- ubytes[3] = (word1 >> 6) & 0xff
- u = struct.unpack_from('<L', ubytes, 0)
- return u[0]
- def unpack_s8(word, pos):
- """Grab a signed byte from offset pos of word"""
- ubytes = bytearray(1)
- ubytes[0] = (word >> pos) & 0xff
- u = struct.unpack_from('<b', ubytes, 0)
- return u[0]
- def unpack_u8(word, pos):
- """Grab an unsigned byte from offset pos of word"""
- ubytes = bytearray(1)
- ubytes[0] = (word >> pos) & 0xff
- u = struct.unpack_from('<B', ubytes, 0)
- return u[0]
- def flag_s(flag, descs):
- """Decode flag using descs, return a string. Ignores unknown bits."""
- s = ''
- for key, value in sorted(descs.items()):
- if key == (key & flag):
- s += value
- s += ' '
- return s.strip()
- def index_s(index, descs, nf="Unk"):
- """Decode flag using descs, return a string. Otherwise Unk"""
- if index in descs:
- s = descs[index]
- else:
- s = nf
- return s
- def timestamp():
- """ print current time as a timestamp"""
- now = time.time()
- if 1 == opts['timestamp']:
- print("%.4f" % now)
- elif 2 == opts['timestamp']:
- print("%.4f %s" % (now, time.asctime(time.gmtime(now))))
- class ubx(object):
- """class to hold u-blox stuff"""
-
- last_statement_identifier = None
-
- expect_statement_identifier = False
- def __init__(self):
- pass
-
- speeds = (460800, 230400, 153600, 115200, 57600, 38400, 19200, 9600,
- 4800, 2400, 1200, 600, 300)
-
- gnss_id = {0: 'GPS',
- 1: 'SBAS',
- 2: 'Galileo',
- 3: 'BeiDou',
- 4: 'IMES',
- 5: 'QZSS',
- 6: 'GLONASS'}
-
- port_ids = {0: 'DDC',
- 1: 'UART1',
- 2: 'UART2',
- 3: 'USB',
- 4: 'SPI',
- }
- port_id_map = {v: k for (k, v) in port_ids.items()}
- port_id_map['UART'] = port_id_map['UART1']
- port_ids[5] = 'Reserved'
-
-
- port_ids1 = {0: 'DDC',
- 0x001: 'UART1',
- 0x003: 'USB',
- 0x004: 'SPI',
- 0x100: 'UART1',
- 0x101: 'UNKa',
- 0x102: 'UART2',
- 0x200: 'UNKb',
- 0x201: 'UART2',
- 0x300: 'USB',
- 0x400: 'SPI',
- }
-
-
-
-
-
-
-
- cfgs = (
-
- ("CFG", 0x1FFFFFFF, "", 0, "",
- "get all CFG"),
-
- ("CFG-ANA", 0x1023FFFF, "", 0, "",
- "get all CFG-ANA"),
- ("CFG-ANA-USE_ANA", 0x10230001, "L", 1, "",
- "Use AssistNow Autonomous"),
- ("CFG-ANA-ORBMAXERR", 0x30230002, "U2", 1, "m",
- "Maximum acceptable (modeled) orbit error"),
-
- ("CFG-BATCH", 0x1026FFFF, "", 0, "",
- "get all CFG-BATCH"),
- ("CFG-BATCH-ENABLE", 0x10260013, "L", 1, "",
- "Enable the feature. Needs further configuration."),
- ("CFG-BATCH-PIOENABLE", 0x10260014, "L", 1, "",
- "Enable PIO notification when buffer fill level exceeds WARNTHRS."),
- ("CFG-BATCH-MAXENTRIES", 0x30260015, "U2", 1, "",
- "Size of buffer in number of epochs to store."),
- ("CFG-BATCH-WARNTHRS", 0x30260016, "U2", 1, "",
- "Fill level to trigger PIO notification, number of epochs stored."),
- ("CFG-BATCH-PIOACTIVELOW", 0x10260018, "L", 1, "",
- "Drive CFG-BATCH-PIOID low when buffer fill level reaches WARNTHRS"),
- ("CFG-BATCH-PIOPID", 0x20260019, "U1", 1, "",
- "PIO that is used for buffer fill level notification"),
- ("CFG-BATCH-EXTRAPVT", 0x1026001a, "L", 1, "",
- "Include additional PVT information in UBX-LOG-BATCH messages"),
- ("CFG-BATCH-EXTRAODO", 0x1026001b, "L", 1, "",
- "Include additional ODO information in UBX-LOG-BATCH messages"),
-
- ("CFG-GEOFENCE", 0x2024FFFF, "", 0, "",
- "get all CFG-GEOFENCE"),
- ("CFG-GEOFENCE-CONFLVL", 0x20240011, "E1", 1, "",
- "Required confidence level for state evaluation"),
- ("CFG-GEOFENCE-USE_PIO", 0x10240012, "L", 1, "",
- "Use PIO combined fence state output"),
- ("CFG-GEOFENCE-PINPOL", 0x20240013, "E1", 1, "",
- "PIO pin polarity"),
- ("CFG-GEOFENCE-PIN", 0x20240014, "U1", 1, "",
- "PIO pin number"),
- ("CFG-GEOFENCE-USE_FENCE1", 0x10240020, "L", 1, "",
- "Use first geofence"),
- ("CFG-GEOFENCE-FENCE1_LAT", 0x40240021, "I4", 1e-7, "deg",
- "Latitude of the first geofence circle center"),
- ("CFG-GEOFENCE-FENCE1_LON", 0x40240022, "I4", 1e-7, "deg",
- "Longitude of the first geofence circle center"),
- ("CFG-GEOFENCE-FENCE1_RAD", 0x40240023, "U4", 0.01, "m",
- "Radius of the first geofence circle"),
- ("CFG-GEOFENCE-USE_FENCE2", 0x10240030, "L", 1, "",
- "Use second geofence"),
- ("CFG-GEOFENCE-FENCE2_LAT", 0x40240031, "I4", 1e-7, "deg",
- "Latitude of the second geofence circle center"),
- ("CFG-GEOFENCE-FENCE2_LON", 0x40240032, "I4", 1e-7, "deg",
- "Longitude of the second geofence circle center"),
- ("CFG-GEOFENCE-FENCE2_RAD", 0x40240033, "U4", 0.01, "m",
- "Radius of the second geofence circle"),
- ("CFG-GEOFENCE-USE_FENCE3", 0x10240040, "L", 1, "",
- "Use third geofence"),
- ("CFG-GEOFENCE-FENCE3_LAT", 0x40240041, "I4", 1e-7, "deg",
- "Latitude of the third geofence circle center"),
- ("CFG-GEOFENCE-FENCE3_LON", 0x40240042, "I4", 1e-7, "deg",
- "Longitude of the third geofence circle center"),
- ("CFG-GEOFENCE-FENCE3_RAD", 0x40240043, "U4", 0.01, "m",
- "Radius of the third geofence circle"),
- ("CFG-GEOFENCE-USE_FENCE4", 0x10240050, "L", 1, "",
- "Use fourth geofence"),
- ("CFG-GEOFENCE-FENCE4_LAT", 0x40240051, "I4", 1e-7, "deg",
- "Latitude of the fourth geofence circle center"),
- ("CFG-GEOFENCE-FENCE4_LON", 0x40240052, "I4", 1e-7, "deg",
- "Longitude of the fourth geofence circle center"),
- ("CFG-GEOFENCE-FENCE4_RAD", 0x40240053, "U4", 0.01, "m",
- "Radius of the fourth geofence circle"),
-
- ("CFG-HW", 0x10a3FFFF, "", 0, "",
- "get all CFG-HW"),
- ("CFG-HW-ANT_CFG_VOLTCTRL", 0x10a3002e, "L", 1, "",
- "Active antenna voltage control flag"),
- ("CFG-HW-ANT_CFG_SHORTDET", 0x10a3002f, "L", 1, "",
- "Short antenna detection flag"),
- ("CFG-HW-ANT_CFG_SHORTDET_POL", 0x10a30030, "L", 1, "",
- "Short antenna detection polarity"),
- ("CFG-HW-ANT_CFG_OPENDET", 0x10a30031, "L", 1, "",
- "Open antenna detection flag"),
- ("CFG-HW-ANT_CFG_OPENDET_POL", 0x10a30032, "L", 1, "",
- "Open antenna detection polarity"),
- ("CFG-HW-ANT_CFG_PWRDOWN", 0x10a30033, "L", 1, "",
- "Power down antenna flag"),
- ("CFG-HW-ANT_CFG_PWRDOWN_POL", 0x10a30034, "L", 1, "",
- "Power down antenna logic polarity"),
- ("CFG-HW-ANT_CFG_RECOVER", 0x10a30035, "L", 1, "",
- "Automatic recovery from short state flag"),
- ("CFG-HW-ANT_SUP_SWITCH_PIN", 0x20a30036, "U1", 1, "",
- "ANT1 PIO number"),
- ("CFG-HW-ANT_SUP_SHORT_PIN", 0x20a30037, "U1", 1, "",
- "ANT0 PIO number"),
- ("CFG-HW-ANT_SUP_OPEN_PIN", 0x20a30038, "U1", 1, "",
- "ANT2 PIO number"),
-
- ("CFG-I2C", 0x2051ffff, "", 0, "",
- "get all CFG-I2C"),
- ("CFG-I2C-ADDRESS", 0x20510001, "U1", 1, "",
- "I2C slave address of the receiver"),
- ("CFG-I2C-EXTENDEDTIMEOUT", 0x10510002, "L", 1, "",
- "Flag to disable timeouting the interface after 1.5 s"),
- ("CFG-I2C-ENABLED", 0x10510003, "L", 1, "",
- "Flag to indicate if the I2C interface should be enabled"),
-
- ("CFG-I2CINPROT", 0x1071ffff, "", 0, "",
- "get all CFG-I2CINPROT"),
- ("CFG-I2CINPROT-UBX", 0x10710001, "L", 1, "",
- "Flag to indicate if UBX should be an input on I2C"),
- ("CFG-I2CINPROT-NMEA", 0x10710002, "L", 1, "",
- "Flag to indicate if NMEA should be an input on I2C"),
- ("CFG-I2CINPROT-RTCM2X", 0x10710003, "L", 1, "",
- "Flag to indicate if RTCM2X should be an input on I2C"),
- ("CFG-I2CINPROT-RTCM3X", 0x10710004, "L", 1, "",
- "Flag to indicate if RTCM3X should be input on I2C"),
-
- ("CFG-I2COUTPROT", 0x1072ffff, "", 0, "",
- "get all CFG-I2COUTPROT"),
- ("CFG-I2COUTPROT-UBX", 0x10720001, "L", 1, "",
- "Flag to indicate if UBX should be an output on I2C"),
- ("CFG-I2COUTPROT-NMEA", 0x10720002, "L", 1, "",
- "Flag to indicate if NMEA should be an output on I2C"),
- ("CFG-I2COUTPROT-RTCM3X", 0x10720004, "L", 1, "",
- "Flag to indicate if RTCM3X should be an output on I2C"),
-
- ("CFG-INFMSG", 0x2092ffff, "", 0, "",
- "get all CFG-INFMSG"),
- ("CFG-INFMSG-UBX_I2C", 0x20920001, "X1", 1, "",
- "Information message enable flags for UBX protocol on I2C"),
- ("CFG-INFMSG-UBX_UART1", 0x20920002, "X1", 1, "",
- "Information message enable flags for UBX protocol on UART1"),
- ("CFG-INFMSG-UBX_UART2", 0x20920003, "X1", 1, "",
- "Information message enable flags for UBX protocol on UART2"),
- ("CFG-INFMSG-UBX_USB", 0x20920004, "X1", 1, "",
- "Information message enable flags for UBX protocol on USB"),
- ("CFG-INFMSG-UBX_SPI", 0x20920005, "X1", 1, "",
- "Information message enable flags for UBX protocol on SPI"),
- ("CFG-INFMSG-NMEA_I2C", 0x20920006, "X1", 1, "",
- "Information message enable flags for NMEA protocol on I2C"),
- ("CFG-INFMSG-NMEA_UART1", 0x20920007, "X1", 1, "",
- "Information message enable flags for NMEA protocol on UART1"),
- ("CFG-INFMSG-NMEA_UART2", 0x20920008, "X1", 1, "",
- "Information message enable flags for NMEA protocol on UART2"),
- ("CFG-INFMSG-NMEA_USB", 0x20920009, "X1", 1, "",
- "Information message enable flags for NMEA protocol on USB"),
- ("CFG-INFMSG-NMEA_SPI", 0x2092000a, "X1", 1, "",
- "Information message enable flags for NMEA protocol on SPI"),
-
- ("CFG-ITFM", 0x2041ffff, "", 0, "",
- "get all CFG-ITFM"),
- ("CFG-ITFM-BBTHRESHOLD", 0x20410001, "U1", 1, "",
- "Broadband jamming detection threshold"),
- ("CFG-ITFM-CWTHRESHOLD", 0x20410002, "U1", 1, "",
- "CW jamming detection threshold"),
- ("CFG-ITFM-ENABLE", 0x1041000d, "L", 1, "",
- "Enable interference detection"),
- ("CFG-ITFM-ANTSETTING", 0x20410010, "E1", 1, "",
- "Antenna setting"),
- ("CFG-ITFM-ENABLE_AUX", 0x10410013, "L", 1, "",
- "Set to true to scan auxiliary bands"),
-
- ("CFG-LOGFILTER", 0x10deffff, "", 0, "",
- "get all CFG-LOGFILTER"),
- ("CFG-LOGFILTER-RECORD_ENA", 0x10de0002, "L", 1, "",
- "Recording enabled"),
- ("CFG-LOGFILTER-ONCE_PER_WAKE_UP_ENA", 0x10de0003, "L", 1, "",
- "Once per wakeup"),
- ("CFG-LOGFILTER-APPLY_ALL_FILTERS", 0x10de0004, "L", 1, "",
- "Apply all filter settings"),
- ("CFG-LOGFILTER-MIN_INTERVAL", 0x30de0005, "U2", 1, "s",
- "Minimum time interval between logged positions"),
- ("CFG-LOGFILTER-TIME_THRS", 0x30de0006, "U2", 1, "s",
- "Time threshold"),
- ("CFG-LOGFILTER-SPEED_THRS", 0x30de0007, "U2", 1, "m/s",
- "Speed threshold"),
- ("CFG-LOGFILTER-POSITION_THRS", 0x40de0008, "U4", 1, "m",
- "Position threshold"),
-
- ("CFG-MOT", 0x3025ffff, "", 0, "",
- "get all CFG-MOT"),
- ("CFG-MOT-GNSSSPEED_THRS", 0x20250038, "U1", 0.01, "m/s",
- "GNSS speed threshold below which platform is considered "
- "as stationary"),
- ("CFG-MOT-GNSSDIST_THRS", 0x3025003b, "U2", 1, "",
- "Distance above which GNSS-based stationary motion is exit"),
-
- ("CFG-MSGOUT", 0x2091ffff, "", 0, "",
- "get all CFG-MSGOUT"),
- ("CFG-MSGOUT-NMEA_ID_DTM_I2C", 0x209100a6, "U1", 1, "",
- "Output rate of the NMEA-GX-DTM message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_DTM_SPI", 0x209100aa, "U1", 1, "",
- "Output rate of the NMEA-GX-DTM message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_DTM_UART1", 0x209100a7, "U1", 1, "",
- "Output rate of the NMEA-GX-DTM message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_DTM_UART2", 0x209100a8, "U1", 1, "",
- "Output rate of the NMEA-GX-DTM message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_DTM_USB", 0x209100a9, "U1", 1, "",
- "Output rate of the NMEA-GX-DTM message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_GBS_I2C", 0x209100dd, "U1", 1, "",
- "Output rate of the NMEA-GX-GBS message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_GBS_SPI", 0x209100e1, "U1", 1, "",
- "Output rate of the NMEA-GX-GBS message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_GBS_UART1", 0x209100de, "U1", 1, "",
- "Output rate of the NMEA-GX-GBS message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_GBS_UART2", 0x209100df, "U1", 1, "",
- "Output rate of the NMEA-GX-GBS message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_GBS_USB", 0x209100e0, "U1", 1, "",
- "Output rate of the NMEA-GX-GBS message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_GGA_I2C", 0x209100ba, "U1", 1, "",
- "Output rate of the NMEA-GX-GGA message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_GGA_SPI", 0x209100be, "U1", 1, "",
- "Output rate of the NMEA-GX-GGA message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_GGA_UART1", 0x209100bb, "U1", 1, "",
- "Output rate of the NMEA-GX-GGA message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_GGA_UART2", 0x209100bc, "U1", 1, "",
- "Output rate of the NMEA-GX-GGA message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_GGA_USB", 0x209100bd, "U1", 1, "",
- "Output rate of the NMEA-GX-GGA message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_GLL_I2C", 0x209100c9, "U1", 1, "",
- "Output rate of the NMEA-GX-GLL message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_GLL_SPI", 0x209100cd, "U1", 1, "",
- "Output rate of the NMEA-GX-GLL message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_GLL_UART1", 0x209100ca, "U1", 1, "",
- "Output rate of the NMEA-GX-GLL message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_GLL_UART2", 0x209100cb, "U1", 1, "",
- "Output rate of the NMEA-GX-GLL message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_GLL_USB", 0x209100cc, "U1", 1, "",
- "Output rate of the NMEA-GX-GLL message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_GNS_I2C", 0x209100b5, "U1", 1, "",
- "Output rate of the NMEA-GX-GNS message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_GNS_SPI", 0x209100b9, "U1", 1, "",
- "Output rate of the NMEA-GX-GNS message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_GNS_UART1", 0x209100b6, "U1", 1, "",
- "Output rate of the NMEA-GX-GNS message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_GNS_UART2", 0x209100b7, "U1", 1, "",
- "Output rate of the NMEA-GX-GNS message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_GNS_USB", 0x209100b8, "U1", 1, "",
- "Output rate of the NMEA-GX-GNS message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_GRS_I2C", 0x209100ce, "U1", 1, "",
- "Output rate of the NMEA-GX-GRS message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_GRS_SPI", 0x209100d2, "U1", 1, "",
- "Output rate of the NMEA-GX-GRS message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_GRS_UART1", 0x209100cf, "U1", 1, "",
- "Output rate of the NMEA-GX-GRS message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_GRS_UART2", 0x209100d0, "U1", 1, "",
- "Output rate of the NMEA-GX-GRS message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_GRS_USB", 0x209100d1, "U1", 1, "",
- "Output rate of the NMEA-GX-GRS message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_GSA_I2C", 0x209100bf, "U1", 1, "",
- "Output rate of the NMEA-GX-GSA message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_GSA_SPI", 0x209100c3, "U1", 1, "",
- "Output rate of the NMEA-GX-GSA message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_GSA_UART1", 0x209100c0, "U1", 1, "",
- "Output rate of the NMEA-GX-GSA message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_GSA_UART2", 0x209100c1, "U1", 1, "",
- "Output rate of the NMEA-GX-GSA message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_GSA_USB", 0x209100c2, "U1", 1, "",
- "Output rate of the NMEA-GX-GSA message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_GST_I2C", 0x209100d3, "U1", 1, "",
- "Output rate of the NMEA-GX-GST message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_GST_SPI", 0x209100d7, "U1", 1, "",
- "Output rate of the NMEA-GX-GST message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_GST_UART1", 0x209100d4, "U1", 1, "",
- "Output rate of the NMEA-GX-GST message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_GST_UART2", 0x209100d5, "U1", 1, "",
- "Output rate of the NMEA-GX-GST message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_GST_USB", 0x209100d6, "U1", 1, "",
- "Output rate of the NMEA-GX-GST message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_GSV_I2C", 0x209100c4, "U1", 1, "",
- "Output rate of the NMEA-GX-GSV message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_GSV_SPI", 0x209100c8, "U1", 1, "",
- "Output rate of the NMEA-GX-GSV message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_GSV_UART1", 0x209100c5, "U1", 1, "",
- "Output rate of the NMEA-GX-GSV message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_GSV_UART2", 0x209100c6, "U1", 1, "",
- "Output rate of the NMEA-GX-GSV message on port UART"),
- ("CFG-MSGOUT-NMEA_ID_GSV_USB", 0x209100c7, "U1", 1, "",
- "Output rate of the NMEA-GX-GSV message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_RLM_I2C", 0x20910400, "U1", 1, "",
- "Output rate of the NMEA-GX-RLM message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_RLM_SPI", 0x20910404, "U1", 1, "",
- "Output rate of the NMEA-GX-RLM message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_RLM_UART1", 0x20910401, "U1", 1, "",
- "Output rate of the NMEA-GX-RLM message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_RLM_UART2", 0x20910402, "U1", 1, "",
- "Output rate of the NMEA-GX-RLM message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_RLM_USB", 0x20910403, "U1", 1, "",
- "Output rate of the NMEA-GX-RLM message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_RMC_I2C", 0x209100ab, "U1", 1, "",
- "Output rate of the NMEA-GX-RMC message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_RMC_SPI", 0x209100af, "U1", 1, "",
- "Output rate of the NMEA-GX-RMC message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_RMC_UART1", 0x209100ac, "U1", 1, "",
- "Output rate of the NMEA-GX-RMC message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_RMC_UART2", 0x209100ad, "U1", 1, "",
- "Output rate of the NMEA-GX-RMC message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_RMC_USB", 0x209100ae, "U1", 1, "",
- "Output rate of the NMEA-GX-RMC message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_VLW_I2C", 0x209100e7, "U1", 1, "",
- "Output rate of the NMEA-GX-VLW message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_VLW_SPI", 0x209100eb, "U1", 1, "",
- "Output rate of the NMEA-GX-VLW message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_VLW_UART1", 0x209100e8, "U1", 1, "",
- "Output rate of the NMEA-GX-VLW message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_VLW_UART2", 0x209100e9, "U1", 1, "",
- "Output rate of the NMEA-GX-VLW message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_VLW_USB", 0x209100ea, "U1", 1, "",
- "Output rate of the NMEA-GX-VLW message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_VTG_I2C", 0x209100b0, "U1", 1, "",
- "Output rate of the NMEA-GX-VTG message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_VTG_SPI", 0x209100b4, "U1", 1, "",
- "Output rate of the NMEA-GX-VTG message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_VTG_UART1", 0x209100b1, "U1", 1, "",
- "Output rate of the NMEA-GX-VTG message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_VTG_UART2", 0x209100b2, "U1", 1, "",
- "Output rate of the NMEA-GX-VTG message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_VTG_USB", 0x209100b3, "U1", 1, "",
- "Output rate of the NMEA-GX-VTG message on port USB"),
- ("CFG-MSGOUT-NMEA_ID_ZDA_I2C", 0x209100d8, "U1", 1, "",
- "Output rate of the NMEA-GX-ZDA message on port I2C"),
- ("CFG-MSGOUT-NMEA_ID_ZDA_SPI", 0x209100dc, "U1", 1, "",
- "Output rate of the NMEA-GX-ZDA message on port SPI"),
- ("CFG-MSGOUT-NMEA_ID_ZDA_UART1", 0x209100d9, "U1", 1, "",
- "Output rate of the NMEA-GX-ZDA message on port UART1"),
- ("CFG-MSGOUT-NMEA_ID_ZDA_UART2", 0x209100da, "U1", 1, "",
- "Output rate of the NMEA-GX-ZDA message on port UART2"),
- ("CFG-MSGOUT-NMEA_ID_ZDA_USB", 0x209100db, "U1", 1, "",
- "Output rate of the NMEA-GX-ZDA message on port USB"),
-
- ("CFG-MSGOUT-PUBX_ID_POLYP_I2C", 0x209100ec, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX00 message on port I2C"),
- ("CFG-MSGOUT-PUBX_ID_POLYP_SPI", 0x209100f0, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX00 message on port SPI"),
- ("CFG-MSGOUT-PUBX_ID_POLYP_UART1", 0x209100ed, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX00 message on port UART1"),
- ("CFG-MSGOUT-PUBX_ID_POLYP_UART2", 0x209100ee, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX00 message on port UART2"),
- ("CFG-MSGOUT-PUBX_ID_POLYP_USB", 0x209100ef, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX00 message on port USB"),
- ("CFG-MSGOUT-PUBX_ID_POLYS_I2C", 0x209100f1, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX03 message on port I2C"),
- ("CFG-MSGOUT-PUBX_ID_POLYS_SPI", 0x209100f5, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX03 message on port SPI"),
- ("CFG-MSGOUT-PUBX_ID_POLYS_UART1", 0x209100f2, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX03 message on port UART1"),
- ("CFG-MSGOUT-PUBX_ID_POLYS_UART2", 0x209100f3, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX03 message on port UART2"),
- ("CFG-MSGOUT-PUBX_ID_POLYS_USB", 0x209100f4, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX03 message on port USB"),
- ("CFG-MSGOUT-PUBX_ID_POLYT_I2C", 0x209100f6, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX04 message on port I2C"),
- ("CFG-MSGOUT-PUBX_ID_POLYT_SPI", 0x209100fa, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX04 message on port SPI"),
- ("CFG-MSGOUT-PUBX_ID_POLYT_UART1", 0x209100f7, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX04 message on port UART1"),
- ("CFG-MSGOUT-PUBX_ID_POLYT_UART2", 0x209100f8, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX04 message on port UART2"),
- ("CFG-MSGOUT-PUBX_ID_POLYT_USB", 0x209100f9, "U1", 1, "",
- "Output rate of the NMEA-GX-PUBX04 message on port USB"),
-
- ("CFG-MSGOUT-RTCM_3X_TYPE1005_I2C", 0x209102bd, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1005 message on port I2C"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1005_SPI", 0x209102c1, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1005 message on port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1005_UART1", 0x209102be, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1005 message on port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1005_UART2", 0x209102bf, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1005 message on port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1005_USB", 0x209102c0, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1005 message on port USB"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1074_I2C", 0x2091035e, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1074 message on port I2C"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1074_SPI", 0x20910362, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1074 message on port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1074_UART1", 0x2091035f, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1074 message on port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1074_UART2", 0x20910360, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1074 message on port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1074_USB", 0x20910361, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1074 message on port USB"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1077_I2C", 0x209102cc, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1077 message on port I2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1077_SPI", 0x209102d0, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1077 message on port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1077_UART1", 0x209102cd, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1077 message on port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1077_UART2", 0x209102ce, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1077 message on port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1077_USB", 0x209102cf, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1077 message on port USB"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1087_I2C", 0x209102d1, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1087 message on port I2C"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1084_SPI", 0x20910367, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1084 message on port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1084_UART1", 0x20910364, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1084 message on port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1084_UART2", 0x20910365, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1084 message on port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1084_USB", 0x20910366, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1084 message on port USB"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1087_SPI", 0x209102d5, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1087 message on port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1087_UART1", 0x209102d2, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1087 message on port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1087_UART2", 0x209102d3, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1087 message on port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1087_USB", 0x209102d4, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1087 message on port USB"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1094_I2C", 0x20910368, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1094 message on port I2C"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1094_SPI", 0x2091036c, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1094 message on port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1094_UART1", 0x20910369, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1094 message on port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1094_UART2", 0x2091036a, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1094 message on port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1094_USB", 0x2091036b, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1094 message on port USB"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1097_I2C", 0x20910318, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1097 message on port I2C"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1097_SPI", 0x2091031c, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1097 message on port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1097_UART1", 0x20910319, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1097 message on port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1097_UART2", 0x2091031a, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1097 message on port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1097_USB", 0x2091031b, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1097 message on port USB"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1124_I2C", 0x2091036d, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1124 message on port I2C"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1124_SPI", 0x20910371, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1124 message on port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1124_UART1", 0x2091036e, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1124 message on port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1124_UART2", 0x2091036f, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1124 message on port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1124_USB", 0x20910370, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1124 message on port USB"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1127_I2C", 0x209102d6, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1127 message on port I2C"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1127_SPI", 0x209102da, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1127 message on port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1127_UART1", 0x209102d7, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1127 message on port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1127_UART2", 0x209102d8, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1127 message on port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1127_USB", 0x209102d9, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1127 message on port USB"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1230_I2C", 0x20910303, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1230 message on port I2C"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1230_SPI", 0x20910307, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1230 message on port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1230_UART1", 0x20910304, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1230 message on port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1230_UART2", 0x20910305, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1230 message on port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE1230_USB", 0x20910306, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE1230 message on port USB"),
- ("CFG-MSGOUT-RTCM_3X_TYPE4072_0_I2C", 0x209102fe, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE4072, sub-type 0 message "
- "on port I2C"),
- ("CFG-MSGOUT-RTCM_3X_TYPE4072_0_SPI", 0x20910302, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE4072, sub-type 0 message "
- "on port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE4072_0_UART1", 0x209102ff, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE4072, sub-type 0 message "
- "on port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE4072_0_UART2", 0x20910300, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE4072, sub-type 0 message "
- "on port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE4072_0_USB", 0x20910301, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE4072, sub-type 0 message "
- "on port USB"),
- ("CFG-MSGOUT-RTCM_3X_TYPE4072_1_I2C", 0x20910381, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE4072, sub-type 1 message on "
- "port I2C"),
- ("CFG-MSGOUT-RTCM_3X_TYPE4072_1_SPI", 0x20910385, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE4072, sub-type 1 message on "
- "port SPI"),
- ("CFG-MSGOUT-RTCM_3X_TYPE4072_1_UART1", 0x20910382, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE4072, sub-type 1 message on "
- "port UART1"),
- ("CFG-MSGOUT-RTCM_3X_TYPE4072_1_UART2", 0x20910383, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE4072, sub-type 1 message on "
- " port UART2"),
- ("CFG-MSGOUT-RTCM_3X_TYPE4072_1_USB", 0x20910384, "U1", 1, "",
- "Output rate of the RTCM-3X-TYPE4072, sub-type 1 message "
- "on port USB"),
-
- ("CFG-MSGOUT-UBX_LOG_INFO_I2C", 0x20910259, "U1", 1, "",
- "Output rate of the UBX-LOG-INFO message on port I2C"),
- ("CFG-MSGOUT-UBX_LOG_INFO_SPI", 0x2091025d, "U1", 1, "",
- "Output rate of the UBX-LOG-INFO message on port SPI"),
- ("CFG-MSGOUT-UBX_LOG_INFO_UART1", 0x2091025a, "U1", 1, "",
- "Output rate of the UBX-LOG-INFO message on port UART1"),
- ("CFG-MSGOUT-UBX_LOG_INFO_UART2", 0x2091025b, "U1", 1, "",
- "Output rate of the UBX-LOG-INFO message on port UART2"),
- ("CFG-MSGOUT-UBX_LOG_INFO_USB", 0x2091025c, "U1", 1, "",
- "Output rate of the UBX-LOG-INFO message on port USB"),
-
- ("CFG-MSGOUT-UBX_MON_COMMS_I2C", 0x2091034f, "U1", 1, "",
- "Output rate of the UBX-MON-COMMS message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_COMMS_SPI", 0x20910353, "U1", 1, "",
- "Output rate of the UBX-MON-COMMS message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_COMMS_UART1", 0x20910350, "U1", 1, "",
- "Output rate of the UBX-MON-COMMS message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_COMMS_UART2", 0x20910351, "U1", 1, "",
- "Output rate of the UBX-MON-COMMS message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_COMMS_USB", 0x20910352, "U1", 1, "",
- "Output rate of the UBX-MON-COMMS message on port USB"),
- ("CFG-MSGOUT-UBX_MON_HW2_I2C", 0x209101b9, "U1", 1, "",
- "Output rate of the UBX-MON-HW2 message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_HW2_SPI", 0x209101bd, "U1", 1, "",
- "Output rate of the UBX-MON-HW2 message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_HW2_UART1", 0x209101ba, "U1", 1, "",
- "Output rate of the UBX-MON-HW2 message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_HW2_UART2", 0x209101bb, "U1", 1, "",
- "Output rate of the UBX-MON-HW2 message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_HW2_USB", 0x209101bc, "U1", 1, "",
- "Output rate of the UBX-MON-HW2 message on port USB"),
- ("CFG-MSGOUT-UBX_MON_HW3_I2C", 0x20910354, "U1", 1, "",
- "Output rate of the UBX-MON-HW3 message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_HW3_SPI", 0x20910358, "U1", 1, "",
- "Output rate of the UBX-MON-HW3 message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_HW3_UART1", 0x20910355, "U1", 1, "",
- "Output rate of the UBX-MON-HW3 message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_HW3_UART2", 0x20910356, "U1", 1, "",
- "Output rate of the UBX-MON-HW3 message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_HW3_USB", 0x20910357, "U1", 1, "",
- "Output rate of the UBX-MON-HW3 message on port USB"),
- ("CFG-MSGOUT-UBX_MON_HW_I2C", 0x209101b4, "U1", 1, "",
- "Output rate of the UBX-MON-HW message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_HW_SPI", 0x209101b8, "U1", 1, "",
- "Output rate of the UBX-MON-HW message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_HW_UART1", 0x209101b5, "U1", 1, "",
- "Output rate of the UBX-MON-HW message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_HW_UART2", 0x209101b6, "U1", 1, "",
- "Output rate of the UBX-MON-HW message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_HW_USB", 0x209101b7, "U1", 1, "",
- "Output rate of the UBX-MON-HW message on port USB"),
- ("CFG-MSGOUT-UBX_MON_IO_I2C", 0x209101a5, "U1", 1, "",
- "Output rate of the UBX-MON-IO message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_IO_SPI", 0x209101a9, "U1", 1, "",
- "Output rate of the UBX-MON-IO message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_IO_UART1", 0x209101a6, "U1", 1, "",
- "Output rate of the UBX-MON-IO message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_IO_UART2", 0x209101a7, "U1", 1, "",
- "Output rate of the UBX-MON-IO message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_IO_USB", 0x209101a8, "U1", 1, "",
- "Output rate of the UBX-MON-IO message on port USB"),
- ("CFG-MSGOUT-UBX_MON_MSGPP_I2C", 0x20910196, "U1", 1, "",
- "Output rate of the UBX-MON-MSGPP message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_MSGPP_SPI", 0x2091019a, "U1", 1, "",
- "Output rate of the UBX-MON-MSGPP message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_MSGPP_UART1", 0x20910197, "U1", 1, "",
- "Output rate of the UBX-MON-MSGPP message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_MSGPP_UART2", 0x20910198, "U1", 1, "",
- "Output rate of the UBX-MON-MSGPP message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_MSGPP_USB", 0x20910199, "U1", 1, "",
- "Output rate of the UBX-MON-MSGPP message on port USB"),
- ("CFG-MSGOUT-UBX_MON_RF_I2C", 0x20910359, "U1", 1, "",
- "Output rate of the UBX-MON-RF message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_RF_SPI", 0x2091035d, "U1", 1, "",
- "Output rate of the UBX-MON-RF message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_RF_UART1", 0x2091035a, "U1", 1, "",
- "Output rate of the UBX-MON-RF message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_RF_UART2", 0x2091035b, "U1", 1, "",
- "Output rate of the UBX-MON-RF message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_RF_USB", 0x2091035c, "U1", 1, "",
- "Output rate of the UBX-MON-RF message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_TIMEQZSS_I2C", 0x20910386, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEQZSS message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_TIMEQZSS_SPI", 0x2091038a, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEQZSS message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_TIMEQZSS_USB", 0x20910387, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEQZSS message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_TIMEQZSS_UART1", 0x20910388, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEQZSS message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_TIMEQZSS_UART2", 0x20910389, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEQZSS message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_RXBUF_I2C", 0x209101a0, "U1", 1, "",
- "Output rate of the UBX-MON-RXBUF message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_RXBUF_SPI", 0x209101a4, "U1", 1, "",
- "Output rate of the UBX-MON-RXBUF message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_RXBUF_UART1", 0x209101a1, "U1", 1, "",
- "Output rate of the UBX-MON-RXBUF message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_RXBUF_UART2", 0x209101a2, "U1", 1, "",
- "Output rate of the UBX-MON-RXBUF message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_RXBUF_USB", 0x209101a3, "U1", 1, "",
- "Output rate of the UBX-MON-RXBUF message on port USB"),
- ("CFG-MSGOUT-UBX_MON_RXR_I2C", 0x20910187, "U1", 1, "",
- "Output rate of the UBX-MON-RXR message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_RXR_SPI", 0x2091018b, "U1", 1, "",
- "Output rate of the UBX-MON-RXR message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_RXR_UART1", 0x20910188, "U1", 1, "",
- "Output rate of the UBX-MON-RXR message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_RXR_UART2", 0x20910189, "U1", 1, "",
- "Output rate of the UBX-MON-RXR message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_RXR_USB", 0x2091018a, "U1", 1, "",
- "Output rate of the UBX-MON-RXR message on port USB"),
- ("CFG-MSGOUT-UBX_MON_SPAN_I2C", 0x2091038b, "U1", 1, "",
- "Output rate of the UBX-MON-SPAN message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_SPAN_SPI", 0x2091038f, "U1", 1, "",
- "Output rate of the UBX-MON-SPAN message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_SPAN_UART1", 0x2091038c, "U1", 1, "",
- "Output rate of the UBX-MON-SPAN message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_SPAN_UART2", 0x2091038d, "U1", 1, "",
- "Output rate of the UBX-MON-SPAN message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_SPAN_USB", 0x2091038e, "U1", 1, "",
- "Output rate of the UBX-MON-SPAN message on port USB"),
- ("CFG-MSGOUT-UBX_MON_TXBUF_I2C", 0x2091019b, "U1", 1, "",
- "Output rate of the UBX-MON-TXBUF message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_TXBUF_SPI", 0x2091019f, "U1", 1, "",
- "Output rate of the UBX-MON-TXBUF message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_TXBUF_UART1", 0x2091019c, "U1", 1, "",
- "Output rate of the UBX-MON-TXBUF message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_TXBUF_UART2", 0x2091019d, "U1", 1, "",
- "Output rate of the UBX-MON-TXBUF message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_TXBUF_USB", 0x2091019e, "U1", 1, "",
- "Output rate of the UBX-MON-TXBUF message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_AOPSTATUS_I2C", 0x20910079, "U1", 1, "",
- "Output rate of the UBX-MON-AOPSTATUS message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_AOPSTATUS_SPI", 0x2091007d, "U1", 1, "",
- "Output rate of the UBX-MON-AOPSTATUS message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_AOPSTATUS_UART1", 0x2091007a, "U1", 1, "",
- "Output rate of the UBX-MON-AOPSTATUS message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_AOPSTATUS_UART2", 0x2091007b, "U1", 1, "",
- "Output rate of the UBX-MON-AOPSTATUS message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_AOPSTATUS_USB", 0x2091007c, "U1", 1, "",
- "Output rate of the UBX-MON-AOPSTATUS message on port USB"),
- ("CFG-MSGOUT-UBX_MON_TXBUF_I2C", 0x2091019b, "U1", 1, "",
- "Output rate of the UBX-MON-TXBUF message on port I2C"),
- ("CFG-MSGOUT-UBX_MON_TXBUF_SPI", 0x2091019f, "U1", 1, "",
- "Output rate of the UBX-MON-TXBUF message on port SPI"),
- ("CFG-MSGOUT-UBX_MON_TXBUF_UART1", 0x2091019c, "U1", 1, "",
- "Output rate of the UBX-MON-TXBUF message on port UART1"),
- ("CFG-MSGOUT-UBX_MON_TXBUF_UART2", 0x2091019d, "U1", 1, "",
- "Output rate of the UBX-MON-TXBUF message on port UART2"),
- ("CFG-MSGOUT-UBX_MON_TXBUF_USB", 0x2091019e, "U1", 1, "",
- "Output rate of the UBX-MON-TXBUF message on port USB"),
-
- ("CFG-MSGOUT-UBX_NAV_CLOCK_I2C", 0x20910065, "U1", 1, "",
- "Output rate of the UBX-NAV-CLOCK message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_CLOCK_SPI", 0x20910069, "U1", 1, "",
- "Output rate of the UBX-NAV-CLOCK message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_CLOCK_UART1", 0x20910066, "U1", 1, "",
- "Output rate of the UBX-NAV-CLOCK message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_CLOCK_UART2", 0x20910067, "U1", 1, "",
- "Output rate of the UBX-NAV-CLOCK message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_CLOCK_USB", 0x20910068, "U1", 1, "",
- "Output rate of the UBX-NAV- CLOCK message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_DOP_I2C", 0x20910038, "U1", 1, "",
- "Output rate of the UBX-NAV-DOP message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_DOP_SPI", 0x2091003c, "U1", 1, "",
- "Output rate of the UBX-NAV-DOP message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_DOP_UART1", 0x20910039, "U1", 1, "",
- "Output rate of the UBX-NAV-DOP message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_DOP_UART2", 0x2091003a, "U1", 1, "",
- "Output rate of the UBX-NAV-DOP message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_DOP_USB", 0x2091003b, "U1", 1, "",
- "Output rate of the UBX-NAV-DOP message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_EOE_I2C", 0x2091015f, "U1", 1, "",
- "Output rate of the UBX-NAV-EOE message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_EOE_SPI", 0x20910163, "U1", 1, "",
- "Output rate of the UBX-NAV-EOE message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_EOE_UART1", 0x20910160, "U1", 1, "",
- "Output rate of the UBX-NAV-EOE message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_EOE_UART2", 0x20910161, "U1", 1, "",
- "Output rate of the UBX-NAV-EOE message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_EOE_USB", 0x20910162, "U1", 1, "",
- "Output rate of the UBX-NAV-EOE message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_GEOFENCE_I2C", 0x209100a1, "U1", 1, "",
- "Output rate of the UBX-NAV-GEOFENCE message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_GEOFENCE_SPI", 0x209100a5, "U1", 1, "",
- "Output rate of the UBX-NAV-GEOFENCE message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_GEOFENCE_UART1", 0x209100a2, "U1", 1, "",
- "Output rate of the UBX-NAV-GEOFENCE message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_GEOFENCE_UART2", 0x209100a3, "U1", 1, "",
- "Output rate of the UBX-NAV-GEOFENCE message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_GEOFENCE_USB", 0x209100a4, "U1", 1, "",
- "Output rate of the UBX-NAV- GEOFENCE message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_HPPOSECEF_I2C", 0x2091002e, "U1", 1, "",
- "Output rate of the UBX-NAV-HPPOSECEF message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_HPPOSECEF_SPI", 0x20910032, "U1", 1, "",
- "Output rate of the UBX-NAV-HPPOSECEF message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_HPPOSECEF_UART1", 0x2091002f, "U1", 1, "",
- "Output rate of the UBX-NAV-HPPOSECEF message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_HPPOSECEF_UART2", 0x20910030, "U1", 1, "",
- "Output rate of the UBX-NAV-HPPOSECEF message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_HPPOSECEF_USB", 0x20910031, "U1", 1, "",
- "Output rate of the UBX-NAV-HPPOSECEF message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_HPPOSLLH_I2C", 0x20910033, "U1", 1, "",
- "Output rate of the UBX-NAV-HPPOSLLH message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_HPPOSLLH_SPI", 0x20910037, "U1", 1, "",
- "Output rate of the UBX-NAV-HPPOSLLH message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_HPPOSLLH_UART1", 0x20910034, "U1", 1, "",
- "Output rate of the UBX-NAV-HPPOSLLH message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_HPPOSLLH_UART2", 0x20910035, "U1", 1, "",
- "Output rate of the UBX-NAV-HPPOSLLH message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_HPPOSLLH_USB", 0x20910036, "U1", 1, "",
- "Output rate of the UBX-NAV-HPPOSLLH message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_ODO_I2C", 0x2091007e, "U1", 1, "",
- "Output rate of the UBX-NAV-ODO message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_ODO_SPI", 0x20910082, "U1", 1, "",
- "Output rate of the UBX-NAV-ODO message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_ODO_UART1", 0x2091007f, "U1", 1, "",
- "Output rate of the UBX-NAV-ODO message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_ODO_UART2", 0x20910080, "U1", 1, "",
- "Output rate of the UBX-NAV-ODO message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_ODO_USB", 0x20910081, "U1", 1, "",
- "Output rate of the UBX-NAV-ODO message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_ORB_I2C", 0x20910010, "U1", 1, "",
- "Output rate of the UBX-NAV-ORB message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_ORB_SPI", 0x20910014, "U1", 1, "",
- "Output rate of the UBX-NAV-ORB message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_ORB_UART1", 0x20910011, "U1", 1, "",
- "Output rate of the UBX-NAV-ORB message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_ORB_UART2", 0x20910012, "U1", 1, "",
- "Output rate of the UBX-NAV-ORB message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_ORB_USB", 0x20910013, "U1", 1, "",
- "Output rate of the UBX-NAV-ORB message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_POSECEF_I2C", 0x20910024, "U1", 1, "",
- "Output rate of the UBX-NAV-POSECEF message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_POSECEF_SPI", 0x20910028, "U1", 1, "",
- "Output rate of the UBX-NAV-POSECEF message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_POSECEF_UART1", 0x20910025, "U1", 1, "",
- "Output rate of the UBX-NAV-POSECEF message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_POSECEF_UART2", 0x20910026, "U1", 1, "",
- "Output rate of the UBX-NAV-POSECEF message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_POSECEF_USB", 0x20910027, "U1", 1, "",
- "Output rate of the UBX-NAV-POSECEF message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_POSLLH_I2C", 0x20910029, "U1", 1, "",
- "Output rate of the UBX-NAV-POSLLH message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_POSLLH_SPI", 0x2091002d, "U1", 1, "",
- "Output rate of the UBX-NAV-POSLLH message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_POSLLH_UART1", 0x2091002a, "U1", 1, "",
- "Output rate of the UBX-NAV-POSLLH message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_POSLLH_UART2", 0x2091002b, "U1", 1, "",
- "Output rate of the UBX-NAV-POSLLH message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_POSLLH_USB", 0x2091002c, "U1", 1, "",
- "Output rate of the UBX-NAV-POSLLH message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_PVT_I2C", 0x20910006, "U1", 1, "",
- "Output rate of the UBX-NAV-PVT message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_PVT_SPI", 0x2091000a, "U1", 1, "",
- "Output rate of the UBX-NAV-PVT message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_PVT_UART1", 0x20910007, "U1", 1, "",
- "Output rate of the UBX-NAV-PVT message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_PVT_UART2", 0x20910008, "U1", 1, "",
- "Output rate of the UBX-NAV-PVT message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_PVT_USB", 0x20910009, "U1", 1, "",
- "Output rate of the UBX-NAV-PVT message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_RELPOSNED_I2C", 0x2091008d, "U1", 1, "",
- "Output rate of the UBX-NAV-RELPOSNED message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_RELPOSNED_SPI", 0x20910091, "U1", 1, "",
- "Output rate of the UBX-NAV-RELPOSNED message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_RELPOSNED_UART1", 0x2091008e, "U1", 1, "",
- "Output rate of the UBX-NAV-RELPOSNED message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_RELPOSNED_UART2", 0x2091008f, "U1", 1, "",
- "Output rate of the UBX-NAV-RELPOSNED message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_RELPOSNED_USB", 0x20910090, "U1", 1, "",
- "Output rate of the UBX-NAV-RELPOSNED message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_SAT_I2C", 0x20910015, "U1", 1, "",
- "Output rate of the UBX-NAV-SAT message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_SAT_SPI", 0x20910019, "U1", 1, "",
- "Output rate of the UBX-NAV-SAT message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_SAT_UART1", 0x20910016, "U1", 1, "",
- "Output rate of the UBX-NAV-SAT message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_SAT_UART2", 0x20910017, "U1", 1, "",
- "Output rate of the UBX-NAV-SAT message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_SAT_USB", 0x20910018, "U1", 1, "",
- "Output rate of the UBX-NAV-SAT message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_SBAS_I2C", 0x2091006a, "U1", 1, "",
- "Output rate of the UBX-NAV-SBAS message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_SBAS_SPI", 0x2091006e, "U1", 1, "",
- "Output rate of the UBX-NAV-SBAS message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_SBAS_UART1", 0x2091006b, "U1", 1, "",
- "Output rate of the UBX-NAV-SBAS message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_SBAS_UART2", 0x2091006c, "U1", 1, "",
- "Output rate of the UBX-NAV-SBAS message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_SBAS_USB", 0x2091006d, "U1", 1, "",
- "Output rate of the UBX-NAV-SBAS message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_SIG_I2C", 0x20910345, "U1", 1, "",
- "Output rate of the UBX-NAV-SIG message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_SIG_SPI", 0x20910349, "U1", 1, "",
- "Output rate of the UBX-NAV-SIG message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_SIG_UART1", 0x20910346, "U1", 1, "",
- "Output rate of the UBX-NAV-SIG message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_SIG_UART2", 0x20910347, "U1", 1, "",
- "Output rate of the UBX-NAV-SIG message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_SIG_USB", 0x20910348, "U1", 1, "",
- "Output rate of the UBX-NAV-SIG message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_SLAS_I2C", 0x20910336, "U1", 1, "",
- "Output rate of the UBX-NAV-SLAS message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_SLAS_SPI", 0x2091033a, "U1", 1, "",
- "Output rate of the UBX-NAV-SLAS message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_SLAS_UART1", 0x20910338, "U1", 1, "",
- "Output rate of the UBX-NAV-SLAS message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_SLAS_UART2", 0x20910339, "U1", 1, "",
- "Output rate of the UBX-NAV-SLAS message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_SLAS_USB", 0x20910348, "U1", 1, "",
- "Output rate of the UBX-NAV-SLAS message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_STATUS_I2C", 0x2091001a, "U1", 1, "",
- "Output rate of the UBX-NAV-STATUS message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_STATUS_SPI", 0x2091001e, "U1", 1, "",
- "Output rate of the UBX-NAV-STATUS message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_STATUS_UART1", 0x2091001b, "U1", 1, "",
- "Output rate of the UBX-NAV-STATUS message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_STATUS_UART2", 0x2091001c, "U1", 1, "",
- "Output rate of the UBX-NAV-STATUS message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_STATUS_USB", 0x2091001d, "U1", 1, "",
- "Output rate of the UBX-NAV-STATUS message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_SVIN_I2C", 0x20910088, "U1", 1, "",
- "Output rate of the UBX-NAV-SVIN message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_SVIN_SPI", 0x2091008c, "U1", 1, "",
- "Output rate of the UBX-NAV-SVIN message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_SVIN_UART1", 0x20910089, "U1", 1, "",
- "Output rate of the UBX-NAV-SVIN message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_SVIN_UART2", 0x2091008a, "U1", 1, "",
- "Output rate of the UBX-NAV-SVIN message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_SVIN_USB", 0x2091008b, "U1", 1, "",
- "Output rate of the UBX-NAV-SVIN message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_TIMEBDS_I2C", 0x20910051, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEBDS message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_TIMEBDS_SPI", 0x20910055, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEBDS message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_TIMEBDS_UART1", 0x20910052, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEBDS message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_TIMEBDS_UART2", 0x20910053, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEBDS message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_TIMEBDS_USB", 0x20910054, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEBDS message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGAL_I2C", 0x20910056, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGAL message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGAL_SPI", 0x2091005a, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGAL message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGAL_UART1", 0x20910057, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGAL message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGAL_UART2", 0x20910058, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGAL message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGAL_USB", 0x20910059, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGAL message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGLO_I2C", 0x2091004c, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGLO message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGLO_SPI", 0x20910050, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGLO message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGLO_UART1", 0x2091004d, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGLO message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGLO_UART2", 0x2091004e, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGLO message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGLO_USB", 0x2091004f, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGLO message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGPS_I2C", 0x20910047, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGPS message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGPS_SPI", 0x2091004b, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGPS message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGPS_UART1", 0x20910048, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGPS message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGPS_UART2", 0x20910049, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGPS message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_TIMEGPS_USB", 0x2091004a, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEGPS message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_TIMELS_I2C", 0x20910060, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMELS message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_TIMELS_SPI", 0x20910064, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMELS message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_TIMELS_UART1", 0x20910061, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMELS message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_TIMELS_UART2", 0x20910062, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMELS message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_TIMELS_USB", 0x20910063, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMELS message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_TIMEUTC_I2C", 0x2091005b, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEUTC message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_TIMEUTC_SPI", 0x2091005f, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEUTC message on port S"),
- ("CFG-MSGOUT-UBX_NAV_TIMEUTC_UART1", 0x2091005c, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEUTC message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_TIMEUTC_UART2", 0x2091005d, "U1", 1, "",
- "Output rate of the UBX-NAV-TIMEUTC message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_TIMEUTC_USB", 0x2091005e, "U1", 1, "",
- "Output rate of the UBX-NAV- TIMEUTC message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_VELECEF_I2C", 0x2091003d, "U1", 1, "",
- "Output rate of the UBX-NAV-VELECEF message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_VELECEF_SPI", 0x20910041, "U1", 1, "",
- "Output rate of the UBX-NAV-VELECEF message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_VELECEF_UART1", 0x2091003e, "U1", 1, "",
- "Output rate of the UBX-NAV-VELECEF message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_VELECEF_UART2", 0x2091003f, "U1", 1, "",
- "Output rate of the UBX-NAV-VELECEF message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_VELECEF_USB", 0x20910040, "U1", 1, "",
- "Output rate of the UBX-NAV-VELECEF message on port USB"),
- ("CFG-MSGOUT-UBX_NAV_VELNED_I2C", 0x20910042, "U1", 1, "",
- "Output rate of the UBX-NAV-VELNED message on port I2C"),
- ("CFG-MSGOUT-UBX_NAV_VELNED_SPI", 0x20910046, "U1", 1, "",
- "Output rate of the UBX-NAV-VELNED message on port SPI"),
- ("CFG-MSGOUT-UBX_NAV_VELNED_UART1", 0x20910043, "U1", 1, "",
- "Output rate of the UBX-NAV-VELNED message on port UART1"),
- ("CFG-MSGOUT-UBX_NAV_VELNED_UART2", 0x20910044, "U1", 1, "",
- "Output rate of the UBX-NAV-VELNED message on port UART2"),
- ("CFG-MSGOUT-UBX_NAV_VELNED_USB", 0x20910045, "U1", 1, "",
- "Output rate of the UBX-NAV-VELNED message on port USB"),
-
- ("CFG-MSGOUT-UBX_RXM_MEASX_I2C", 0x20910204, "U1", 1, "",
- "Output rate of the UBX-RXM-MEASX message on port I2C"),
- ("CFG-MSGOUT-UBX_RXM_MEASX_SPI", 0x20910208, "U1", 1, "",
- "Output rate of the UBX-RXM-MEASX message on port SPI"),
- ("CFG-MSGOUT-UBX_RXM_MEASX_UART1", 0x20910205, "U1", 1, "",
- "Output rate of the UBX-RXM-MEASX message on port UART1"),
- ("CFG-MSGOUT-UBX_RXM_MEASX_UART2", 0x20910206, "U1", 1, "",
- "Output rate of the UBX-RXM-MEASX message on port UART2"),
- ("CFG-MSGOUT-UBX_RXM_MEASX_USB", 0x20910207, "U1", 1, "",
- "Output rate of the UBX-RXM-MEASX message on port USB"),
- ("CFG-MSGOUT-UBX_RXM_RAWX_I2C", 0x209102a4, "U1", 1, "",
- "Output rate of the UBX-RXM-RAWX message on port I2C"),
- ("CFG-MSGOUT-UBX_RXM_RAWX_SPI", 0x209102a8, "U1", 1, "",
- "Output rate of the UBX-RXM-RAWX message on port SPI"),
- ("CFG-MSGOUT-UBX_RXM_RAWX_UART1", 0x209102a5, "U1", 1, "",
- "Output rate of the UBX-RXM-RAWX message on port UART1"),
- ("CFG-MSGOUT-UBX_RXM_RAWX_UART2", 0x209102a6, "U1", 1, "",
- "Output rate of the UBX-RXM-RAWX message on port UART2"),
- ("CFG-MSGOUT-UBX_RXM_RAWX_USB", 0x209102a7, "U1", 1, "",
- "Output rate of the UBX-RXM-RAWX message on port USB"),
- ("CFG-MSGOUT-UBX_RXM_RLM_I2C", 0x2091025e, "U1", 1, "",
- "Output rate of the UBX-RXM-RLM message on port I2C"),
- ("CFG-MSGOUT-UBX_RXM_RLM_SPI", 0x20910262, "U1", 1, "",
- "Output rate of the UBX-RXM-RLM message on port SPI"),
- ("CFG-MSGOUT-UBX_RXM_RLM_UART1", 0x2091025f, "U1", 1, "",
- "Output rate of the UBX-RXM-RLM message on port UART1"),
- ("CFG-MSGOUT-UBX_RXM_RLM_UART2", 0x20910260, "U1", 1, "",
- "Output rate of the UBX-RXM-RLM message on port UART2"),
- ("CFG-MSGOUT-UBX_RXM_RLM_USB", 0x20910261, "U1", 1, "",
- "Output rate of the UBX-RXM-RLM message on port USB"),
- ("CFG-MSGOUT-UBX_RXM_RTCM_I2C", 0x20910268, "U1", 1, "",
- "Output rate of the UBX-RXM-RTCM message on port I2C"),
- ("CFG-MSGOUT-UBX_RXM_RTCM_SPI", 0x2091026c, "U1", 1, "",
- "Output rate of the UBX-RXM-RTCM message on port SPI"),
- ("CFG-MSGOUT-UBX_RXM_RTCM_UART1", 0x20910269, "U1", 1, "",
- "Output rate of the UBX-RXM-RTCM message on port UART1"),
- ("CFG-MSGOUT-UBX_RXM_RTCM_UART2", 0x2091026a, "U1", 1, "",
- "Output rate of the UBX-RXM-RTCM message on port UART2"),
- ("CFG-MSGOUT-UBX_RXM_RTCM_USB", 0x2091026b, "U1", 1, "",
- "Output rate of the UBX-RXM-RTCM message on port USB"),
- ("CFG-MSGOUT-UBX_RXM_SFRBX_I2C", 0x20910231, "U1", 1, "",
- "Output rate of the UBX-RXM-SFRBX message on port I2C"),
- ("CFG-MSGOUT-UBX_RXM_SFRBX_SPI", 0x20910235, "U1", 1, "",
- "Output rate of the UBX-RXM-SFRBX message on port SPI"),
- ("CFG-MSGOUT-UBX_RXM_SFRBX_UART1", 0x20910232, "U1", 1, "",
- "Output rate of the UBX-RXM-SFRBX message on port UART1"),
- ("CFG-MSGOUT-UBX_RXM_SFRBX_UART2", 0x20910233, "U1", 1, "",
- "Output rate of the UBX-RXM-SFRBX message on port UART2"),
- ("CFG-MSGOUT-UBX_RXM_SFRBX_USB", 0x20910234, "U1", 1, "",
- "Output rate of the UBX-RXM-SFRBX message on port USB"),
-
- ("CFG-MSGOUT-UBX_TIM_SVIN_I2C", 0x20910097, "U1", 1, "",
- "Output rate of the UBX-TIM-SVIN message on port I2C"),
- ("CFG-MSGOUT-UBX_TIM_SVIN_SPI", 0x2091009b, "U1", 1, "",
- "Output rate of the UBX-TIM-SVIN message on port SPI"),
- ("CFG-MSGOUT-UBX_TIM_SVIN_UART1", 0x20910098, "U1", 1, "",
- "Output rate of the UBX-TIM-SVIN message on port UART1"),
- ("CFG-MSGOUT-UBX_TIM_SVIN_UART2", 0x20910099, "U1", 1, "",
- "Output rate of the UBX-TIM-SVIN message on port UART2"),
- ("CFG-MSGOUT-UBX_TIM_SVIN_USB", 0x2091009a, "U1", 1, "",
- "Output rate of the UBX-TIM-SVIN message on port USB"),
- ("CFG-MSGOUT-UBX_TIM_TM2_I2C", 0x20910178, "U1", 1, "",
- "Output rate of the UBX-TIM-TM2 message on port I2C"),
- ("CFG-MSGOUT-UBX_TIM_TM2_SPI", 0x2091017c, "U1", 1, "",
- "Output rate of the UBX-TIM-TM2 message on port SPI"),
- ("CFG-MSGOUT-UBX_TIM_TM2_UART1", 0x20910179, "U1", 1, "",
- "Output rate of the UBX-TIM-TM2 message on port UART1"),
- ("CFG-MSGOUT-UBX_TIM_TM2_UART2", 0x2091017a, "U1", 1, "",
- "Output rate of the UBX-TIM-TM2 message on port UART2"),
- ("CFG-MSGOUT-UBX_TIM_TM2_USB", 0x2091017b, "U1", 1, "",
- "Output rate of the UBX-TIM-TM2 message on port USB"),
- ("CFG-MSGOUT-UBX_TIM_TP_I2C", 0x2091017d, "U1", 1, "",
- "Output rate of the UBX-TIM-TP message on port I2C"),
- ("CFG-MSGOUT-UBX_TIM_TP_SPI", 0x20910181, "U1", 1, "",
- "Output rate of the UBX-TIM-TP message on port SPI"),
- ("CFG-MSGOUT-UBX_TIM_TP_UART1", 0x2091017e, "U1", 1, "",
- "Output rate of the UBX-TIM-TP message on port UART1"),
- ("CFG-MSGOUT-UBX_TIM_TP_UART2", 0x2091017f, "U1", 1, "",
- "Output rate of the UBX-TIM-TP message on port UART2"),
- ("CFG-MSGOUT-UBX_TIM_TP_USB", 0x20910180, "U1", 1, "",
- "Output rate of the UBX-TIM-TP message on port USB"),
- ("CFG-MSGOUT-UBX_TIM_VRFY_I2C", 0x20910092, "U1", 1, "",
- "Output rate of the UBX-TIM-VRFY message on port I2C"),
- ("CFG-MSGOUT-UBX_TIM_VRFY_SPI", 0x20910096, "U1", 1, "",
- "Output rate of the UBX-TIM-VRFY message on port SPI"),
- ("CFG-MSGOUT-UBX_TIM_VRFY_UART1", 0x20910093, "U1", 1, "",
- "Output rate of the UBX-TIM-VRFY message on port UART1"),
- ("CFG-MSGOUT-UBX_TIM_VRFY_UART2", 0x20910094, "U1", 1, "",
- "Output rate of the UBX-TIM-VRFY message on port UART2"),
- ("CFG-MSGOUT-UBX_TIM_VRFY_USB", 0x20910095, "U1", 1, "",
- "Output rate of the UBX-TIM-VRFY message on port USB"),
-
- ("CFG-NAVHPG", 0x2014ffff, "", 0, "",
- "get all CFG-NAVHPG"),
- ("CFG-NAVHPG-DGNSSMODE", 0x20140011, "E1", 1, "",
- "Differential corrections mode"),
-
- ("CFG-NAVSPG", 0x2011ffff, "", 0, "",
- "get all CFG-NAVSPG"),
- ("CFG-NAVSPG-FIXMODE", 0x20110011, "E1", 1, "",
- "Position fix mode"),
- ("CFG-NAVSPG-INIFIX3D", 0x10110013, "L", 1, "",
- "Initial fix must be a 3d fix"),
- ("CFG-NAVSPG-WKNROLLOVER", 0x30110017, "U2", 1, "",
- "GPS week rollover number"),
- ("CFG-NAVSPG-USE_PPP", 0x10110019, "L", 1, "",
- "Use Precise Point Positioning"),
- ("CFG-NAVSPG-UTCSTANDARD", 0x2011001c, "E1", 1, "",
- "UTC standard to be used"),
- ("CFG-NAVSPG-DYNMODEL", 0x20110021, "E1", 1, "",
- "Dynamic platform model"),
- ("CFG-NAVSPG-ACKAIDING", 0x10110025, "L", 1, "",
- "Acknowledge assistance input messages"),
- ("CFG-NAVSPG-USE_USRDAT", 0x10110061, "L", 1, "",
- "Use user geodetic datum"),
- ("CFG-NAVSPG-USRDAT_MAJA", 0x50110062, "R8", 1, "m",
- "Geodetic datum semi-major axis"),
- ("CFG-NAVSPG-USRDAT_FLAT", 0x50110063, "R8", 1, "",
- "Geodetic datum 1.0 / flattening"),
- ("CFG-NAVSPG-USRDAT_DX", 0x40110064, "R4", 1, "m",
- "Geodetic datum X axis shift at the origin"),
- ("CFG-NAVSPG-USRDAT_DY", 0x40110065, "R4", 1, "m",
- "Geodetic datum Y axis shift at the origin"),
- ("CFG-NAVSPG-USRDAT_DZ", 0x40110066, "R4", 1, "m",
- "Geodetic datum Z axis shift at the origin"),
- ("CFG-NAVSPG-USRDAT_ROTX", 0x40110067, "R4", 1, "arcsec",
- "Geodetic datum rotation about the X axis"),
- ("CFG-NAVSPG-USRDAT_ROTY", 0x40110068, "R4", 1, "arcsec",
- "Geodetic datum rotation about the Y axis ()"),
- ("CFG-NAVSPG-USRDAT_ROTZ", 0x40110069, "R4", 1, "arcsec",
- "Geodetic datum rotation about the Z axis"),
- ("CFG-NAVSPG-USRDAT_SCALE", 0x4011006a, "R4", 1, "ppm",
- "Geodetic datum scale factor"),
- ("CFG-NAVSPG-INFIL_MINSVS", 0x201100a1, "U1", 1, "",
- "Minimum number of satellites for navigation"),
- ("CFG-NAVSPG-INFIL_MAXSVS", 0x201100a2, "U1", 1, "",
- "Maximum number of satellites for navigation"),
- ("CFG-NAVSPG-INFIL_MINCNO", 0x201100a3, "U1", 1, "dBHz",
- "Minimum satellite signal level for navigation"),
- ("CFG-NAVSPG-INFIL_MINELEV", 0x201100a4, "I1", 1, "deg",
- "Minimum elevation for a GNSS satellite to be used in navigation"),
- ("CFG-NAVSPG-INFIL_NCNOTHRS", 0x201100aa, "U1", 1, "",
- "Number of satellites required to have C/N0 above "
- "CFG-NAVSPG-INFIL_CNOTHRS for a fix to be attempted"),
- ("CFG-NAVSPG-INFIL_CNOTHRS", 0x201100ab, "U1", 1, "",
- "C/N0 threshold for deciding whether to attempt a fix"),
- ("CFG-NAVSPG-OUTFIL_PDOP", 0x301100b1, "U2", 0.1, "",
- "Output filter position DOP mask (threshold)"),
- ("CFG-NAVSPG-OUTFIL_TDOP", 0x301100b2, "U2", 0.11, "",
- "Output filter time DOP mask (threshold)"),
- ("CFG-NAVSPG-OUTFIL_PACC", 0x301100b3, "U2", 1, "m",
- "Output filter position accuracy mask (threshold)"),
- ("CFG-NAVSPG-OUTFIL_TACC", 0x301100b4, "U2", 1, "m",
- "Output filter time accuracy mask (threshold)"),
- ("CFG-NAVSPG-OUTFIL_FACC", 0x301100b5, "U2", 0.01, "m/s",
- "Output filter frequency accuracy mask (threshold)"),
- ("CFG-NAVSPG-CONSTR_ALT", 0x401100c1, "I4", 0.01, "m",
- "Fixed altitude (mean sea level) for 2D fix mode"),
- ("CFG-NAVSPG-CONSTR_ALTVAR", 0x401100c2, "U4", 0.0001, "M^2",
- "Fixed altitude variance for 2D mode"),
- ("CFG-NAVSPG-CONSTR_DGNSSTO", 0x201100c4, "U1", 1, "s",
- "DGNSS timeout"),
- ("CFG-NAVSPG-SIGATTCOMP", 0x201100d6, "E1", 1, "",
- "Permanently attenuated signal compensation mode"),
-
- ("CFG-NMEA", 0x2093ffff, "", 0, "",
- "get all CFG-NMEA"),
- ("CFG-NMEA-PROTVER", 0x20930001, "E1", 1, "",
- "NMEA protocol version"),
- ("CFG-NMEA-MAXSVS", 0x20930002, "E1", 1, "",
- "Maximum number of SVs to report per Talker ID"),
- ("CFG-NMEA-COMPAT", 0x10930003, "L", 1, "",
- "Enable compatibility mode"),
- ("CFG-NMEA-CONSIDER", 0x10930004, "L", 1, "",
- "Enable considering mode"),
- ("CFG-NMEA-LIMIT82", 0x10930005, "L", 1, "",
- "Enable strict limit to 82 characters maximum NMEA message length"),
- ("CFG-NMEA-HIGHPREC", 0x10930006, "L", 1, "",
- "Enable high precision mode"),
- ("CFG-NMEA-SVNUMBERING", 0x20930007, "E1", 1, "",
- "Display configuration for SVs that have no value defined in NMEA"),
- ("CFG-NMEA-FILT_GPS", 0x10930011, "L", 1, "",
- "Disable reporting of GPS satellites"),
- ("CFG-NMEA-FILT_SBAS", 0x10930012, "L", 1, "",
- "Disable reporting of SBAS satellites"),
- ("CFG-NMEA-FILT_GAL", 0x10930013, "L", 1, "",
- "Disable reporting of GALILEO satellites"),
- ("CFG-NMEA-FILT_QZSS", 0x10930015, "L", 1, "",
- "Disable reporting of QZSS satellites"),
- ("CFG-NMEA-FILT_GLO", 0x10930016, "L", 1, "",
- "Disable reporting of GLONASS satellites"),
- ("CFG-NMEA-FILT_BDS", 0x10930017, "L", 1, "",
- "Disable reporting of BeiDou satellites"),
- ("CFG-NMEA-OUT_INVFIX", 0x10930021, "L", 1, "",
- "Enable position output for failed or invalid fixes"),
- ("CFG-NMEA-OUT_MSKFIX", 0x10930022, "L", 1, "",
- "Enable position output for invalid fixes"),
- ("CFG-NMEA-OUT_INVTIME", 0x10930023, "L", 1, "",
- "Enable time output for invalid times"),
- ("CFG-NMEA-OUT_INVDATE", 0x10930024, "L", 1, "",
- "Enable date output for invalid dates"),
- ("CFG-NMEA-OUT_ONLYGPS", 0x10930025, "L", 1, "",
- "Restrict output to GPS satellites only"),
- ("CFG-NMEA-OUT_FROZENCOG", 0x10930026, "L", 1, "",
- "Enable course over ground output even if it is frozen"),
- ("CFG-NMEA-MAINTALKERID", 0x20930031, "E1", 1, "",
- "Main Talker ID"),
- ("CFG-NMEA-GSVTALKERID", 0x20930032, "E1", 1, "",
- "Talker ID for GSV NMEA messages"),
- ("CFG-NMEA-BDSTALKERID", 0x30930033, "U2", 1, "",
- "BeiDou Talker ID"),
-
- ("CFG-ODO", 0x1022ffff, "", 0, "",
- "get all CFG-ODO"),
- ("CFG-ODO-USE_ODO", 0x10220001, "L", 1, "",
- "Use odometer"),
- ("CFG-ODO-USE_COG", 0x10220002, "L", 1, "",
- "Use low-speed course over ground filter"),
- ("CFG-ODO-OUTLPVEL", 0x10220003, "L", 1, "",
- "Output low-pass filtered velocity"),
- ("CFG-ODO-OUTLPCOG", 0x10220004, "L", 1, "",
- "Output low-pass filtered course over ground (heading)"),
- ("CFG-ODO-PROFILE", 0x20220005, "E1", 1, "",
- "Odometer profile configuration"),
- ("CFG-ODO-COGMAXSPEED", 0x20220021, "U1", 1, "m/s",
- "Upper speed limit for low-speed course over ground filter"),
- ("CFG-ODO-COGMAXPOSACC", 0x20220022, "U1", 1, "",
- "Maximum acceptable position accuracy for computing low-speed "
- "filtered course over ground"),
- ("CFG-ODO-COGLPGAIN", 0x20220032, "", 1, "",
- "Course over ground low-pass filter level (at speed < 8 m/s)"),
- ("CFG-ODO-VELLPGAIN", 0x20220031, "U1", 1, "",
- "Velocity low-pass filter level"),
-
- ("CFG-PM", 0x20d0ffff, "", 0, "",
- "get all CFG-PM, reciver power management"),
- ("CFG-PM-OPERATEMODE", 0x20d00001, "L", 1, "",
- "set PSMOO or PSMCT mode"),
- ("CFG-PM-POSUPDATEPERIOD", 0x40d00002, "U4", 1, "",
- "Position update period for PSMOO."),
- ("CFG-PM-ACQPERIOD", 0x40d00003, "U4", 1, "s",
- "Acquisition period if receiver fails to achieve a position fix"),
- ("CFG-PM-GRIDOFFSET", 0x40d00004, "U4", 1, "s",
- "Position update period grid offset relative to GPS start of week."),
- ("CFG-PM-ONTIME", 0x30d00005, "U2", 1, "s",
- "Time to stay in Tracking state."),
- ("CFG-PM-MINACQTIME", 0x20d00006, "U1", 1, "s",
- "Minimum time to spend in Acquisition state"),
- ("CFG-PM-MAXACQTIME", 0x20d00007, "U1", 1, "s",
- "Maximum time to spend in Acquisition state"),
- ("CFG-PM-DONOTENTEROFF", 0x10d00008, "L", 1, "",
- "Behavior when failure to achieve a position during update period."),
- ("CFG-PM-WAITTIMEFIX", 0x10d00009, "L", 1, "",
- "wait for time fix"),
- ("CFG-PM-UPDATEEPH", 0x10d0000a, "L", 1, "",
- "Update ephemeris regularly."),
- ("CFG-PM-EXTINTSEL", 0x20d0000b, "E1", 1, "",
- "EXTINT pin select."),
- ("CFG-PM-EXTINTWAKE", 0x10d0000c, "L", 1, "",
- "EXTINT pin control (Wake)"),
- ("CFG-PM-EXTINTBACKUP", 0x10d0000d, "L", 1, "",
- "EXTINT pin control (Backup)"),
- ("CFG-PM-EXTINTINACTIVE", 0x10d0000e, "L", 1, "",
- "EXTINT pin control (Inactive)"),
- ("CFG-PM-UPDATEEPH", 0x10d0000d, "U4", 0.001, "s",
- "Inactivity time out on EXTINT pin if enabled"),
- ("CFG-PM-LIMITPEAKCURR", 0x10d00010, "L", 1, "",
- "Limit peak current"),
-
- ("CFG-QZSS", 0x3037ffff, "", 0, "s",
- "get all CFG-QZSS"),
- ("CFG-QZSS-USE_SLAS_DGNSS", 0x10370005, "L", 0.001, "",
- "Apply QZSS SLAS DGNSS corrections"),
- ("CFG-QZSS-USE_TESTMODE", 0x10370006, "L", 0.001, "",
- "Use QZSS SLAS data when it is in test mode"),
- ("CFG-QZSS-USE_SLAS_RAIM_UNCORR", 0x10370007, "L", 0.001, "",
- "Raim out measurements that are not corrected by QZSS SLAS"),
-
- ("CFG-RATE", 0x3021ffff, "", 0, "s",
- "get all CFG-RATE"),
- ("CFG-RATE-MEAS", 0x30210001, "U2", 0.001, "s",
- "Nominal time between GNSS measurements"),
- ("CFG-RATE-NAV", 0x30210002, "U2", 1, "",
- "Ratio of number of measurements to number of navigation solutions"),
- ("CFG-RATE-TIMEREF", 0x20210003, "E1", 1, "",
- "Time system to which measurements are aligned"),
-
- ("CFG-RINV", 0x10c7ffff, "", 0, "",
- "get all CFG-RINV"),
- ("CFG-RINV-DUMP", 0x10c70001, "L", 1, "",
- "Dump data at startup"),
- ("CFG-RINV-BINARY", 0x10c70002, "L", 1, "",
- "Data is binary"),
- ("CFG-RINV-DATA_SIZE", 0x20c70003, "U1", 1, "",
- "Size of data"),
- ("CFG-RINV-CHUNK0", 0x50c70004, "X8", 1, "",
- "Data bytes 1-8 (LSB)"),
- ("CFG-RINV-CHUNK1", 0x50c70005, "X8", 1, "",
- "Data bytes 9-16"),
- ("CFG-RINV-CHUNK2", 0x50c70006, "X8", 1, "",
- "Data bytes 17-24"),
- ("CFG-RINV-CHUNK3", 0x50c70007, "X8", 1, "",
- "Data bytes 25-30 (MSB)"),
-
- ("CFG-SBAS", 0x1036ffff, "", 0, "",
- "get all CFG-SBAS"),
- ("CFG-SBAS-USE_TESTMODE", 0x10360002, "L", 1, "",
- "Use SBAS data when it is in test mode"),
- ("CFG-SBAS-USE_RANGING", 0x10360003, "L", 1, "",
- "Use SBAS GEOs as a ranging source (for navigation)"),
- ("CFG-SBAS-USE_DIFFCORR", 0x10360004, "L", 1, "",
- "Use SBAS differential corrections"),
- ("CFG-SBAS-USE_INTEGRITY", 0x10360005, "L", 1, "",
- "Use SBAS integrity information"),
- ("CFG-SBAS-PRNSCANMASK", 0x50360006, "X8", 1, "",
- "SBAS PRN search configuration"),
-
- ("CFG-SIGNAL", 0x1031ffff, "", 0, "",
- "get all CFG-SIGNAL"),
- ("CFG-SIGNAL-GPS_ENA", 0x1031001f, "L", 1, "",
- "GPS enable"),
- ("CFG-SIGNAL-GPS_L1CA_ENA", 0x10310001, "L", 1, "",
- "GPS L1C/A"),
- ("CFG-SIGNAL-GPS_L2C_ENA", 0x10310003, "L", 1, "",
- "GPS L2C"),
- ("CFG-SIGNAL-SBAS_ENA", 0x10310020, "L", 1, "",
- "SBAS enable"),
- ("CFG-SIGNAL-SBAS_L1CA_ENA", 0x10310005, "L", 1, "",
- "SBAS L1C/A"),
- ("CFG-SIGNAL-GAL_ENA", 0x10310021, "L", 1, "",
- "Galileo enable"),
- ("CFG-SIGNAL-GAL_E1_ENA", 0x10310007, "L", 1, "",
- "Galileo E1"),
- ("CFG-SIGNAL-GAL_E5B_ENA", 0x1031000a, "L", 1, "",
- "Galileo E5b"),
- ("CFG-SIGNAL-BDS_ENA", 0x10310022, "L", 1, "",
- "BeiDou Enable"),
- ("CFG-SIGNAL-BDS_B1_ENA", 0x1031000d, "L", 1, "",
- "BeiDou B1I"),
- ("CFG-SIGNAL-BDS_B2_ENA", 0x1031000e, "L", 1, "",
- "BeiDou B2I"),
- ("CFG-SIGNAL-QZSS_ENA", 0x10310024, "L", 1, "",
- "QZSS enable"),
- ("CFG-SIGNAL-QZSS_L1CA_ENA", 0x10310012, "L", 1, "",
- "QZSS L1C/A"),
- ("CFG-SIGNAL-QZSS_L1S_ENA", 0x10310014, "L", 1, "",
- "QZSS L1S"),
- ("CFG-SIGNAL-QZSS_L2C_ENA", 0x10310015, "L", 1, "",
- "QZSS L2C"),
- ("CFG-SIGNAL-GLO_ENA", 0x10310025, "L", 1, "",
- "GLONASS enable"),
- ("CFG-SIGNAL-GLO_L1_ENA", 0x10310018, "L", 1, "",
- "GLONASS L1"),
- ("CFG-SIGNAL-GLO_L2_ENA", 0x1031001a, "L", 1, "",
- "GLONASS L2"),
-
- ("CFG-SPI", 0x1064ffff, "", 0, "",
- "get all CFG-SPI"),
- ("CFG-SPI-MAXFF", 0x20640001, "U1", 1, "",
- "Number of bytes containing 0xFF to receive before "
- "switching off reception."),
- ("CFG-SPI-CPOLARITY", 0x10640002, "L", 1, "",
- "Clock polarity select"),
- ("CFG-SPI-CPHASE", 0x10640003, "L", 1, "",
- "Clock phase select"),
- ("CFG-SPI-EXTENDEDTIMEOUT", 0x10640005, "L", 1, "",
- "Flag to disable timeouting the interface after 1.5s"),
- ("CFG-SPI-ENABLED", 0x10640006, "L", 1, "",
- "Flag to indicate if the SPI interface should be enabled"),
-
- ("CFG-SPIINPROT", 0x1079ffff, "", 0, "",
- "get all CFG-SPIINPROT"),
- ("CFG-SPIINPROT-UBX", 0x10790001, "L", 1, "",
- "Flag to indicate if UBX should be an input protocol on SPI"),
- ("CFG-SPIINPROT-NMEA", 0x10790002, "L", 1, "",
- "Flag to indicate if NMEA should be an input protocol on SPI"),
- ("CFG-SPIINPROT-RTCM2X", 0x10790003, "L", 1, "",
- "Flag to indicate if RTCM2X should be an input protocol on SPI"),
- ("CFG-SPIINPROT-RTCM3X", 0x10790004, "L", 1, "",
- "Flag to indicate if RTCM3X should be an input protocol on SPI"),
-
- ("CFG-SPIOUTPROT", 0x107affff, "", 0, "",
- "get all CFG-SPIOUTPROT"),
- ("CFG-SPIOUTPROT-UBX", 0x107a0001, "L", 1, "",
- "Flag to indicate if UBX should be an output protocol on SPI"),
- ("CFG-SPIOUTPROT-NMEA", 0x107a0002, "L", 1, "",
- "Flag to indicate if NMEA should be an output protocol on SPI"),
- ("CFG-SPIOUTPROT-RTCM3X", 0x107a0004, "L", 1, "",
- "Flag to indicate if RTCM3X should be an output protocol on SPI"),
-
- ("CFG-TMODE", 0x2003ffff, "", 0, "",
- "get all CFG-TMODE"),
- ("CFG-TMODE-MODE", 0x20030001, "E1", 1, "",
- "Receiver mode"),
- ("CFG-TMODE-POS_TYPE", 0x20030002, "E1", 1, "",
- "Determines whether the ARP position is given in ECEF or "
- "LAT/LON/HEIGHT?"),
- ("CFG-TMODE-ECEF_X", 0x40030003, "I4", 1, "cm",
- "ECEF X coordinate of the ARP position."),
- ("CFG-TMODE-ECEF_Y", 0x40030004, "I4", 1, "cm",
- "ECEF Y coordinate of the ARP position."),
- ("CFG-TMODE-ECEF_Z", 0x40030005, "I4", 1, "cm",
- "ECEF Z coordinate of the ARP position."),
- ("CFG-TMODE-ECEF_X_HP", 0x20030006, "I1", 0.1, "mm",
- "High-precision ECEF X coordinate of the ARP position."),
- ("CFG-TMODE-ECEF_Y_HP", 0x20030007, "I1", 0.1, "mm",
- "High-precision ECEF Y coordinate of the ARP position."),
- ("CFG-TMODE-ECEF_Z_HP", 0x20030008, "I1", 0.1, "mm",
- "High-precision ECEF Z coordinate of the ARP position."),
- ("CFG-TMODE-LAT", 0x40030009, "I4", 1e-7, "deg",
- "Latitude of the ARP position."),
- ("CFG-TMODE-LON", 0x4003000a, "I4", 1e-7, "deg",
- "Longitude of the ARP position."),
- ("CFG-TMODE-HEIGHT", 0x4003000b, "I4", 1, "cm",
- "Height of the ARP position."),
- ("CFG-TMODE-LAT_HP", 0x2003000c, "I1", 1e-9, "deg",
- "High-precision latitude of the ARP position"),
- ("CFG-TMODE-LON_HP", 0x2003000d, "I1", 1e-9, "deg",
- "High-precision longitude of the ARP position."),
- ("CFG-TMODE-HEIGHT_HP", 0x2003000e, "I1", 0.1, "mm",
- "High-precision height of the ARP position."),
- ("CFG-TMODE-FIXED_POS_ACC", 0x4003000f, "U4", 0.1, "mm",
- "Fixed position 3D accuracy"),
- ("CFG-TMODE-SVIN_MIN_DUR", 0x40030010, "U4", 1, "s",
- "Survey-in minimum duration"),
- ("CFG-TMODE-SVIN_ACC_LIMIT", 0x40030011, "U4", 0.1, "mm",
- "Survey-in position accuracy limit"),
-
- ("CFG-TP", 0x3005ffff, "", 0, "",
- "get all CFG-TP"),
- ("CFG-TP-PULSE_DEF", 0x20050023, "E1", 1, "",
- "Determines whether the time pulse is interpreted as frequency "
- "or period?"),
- ("CFG-TP-PULSE_LENGTH_DEF", 0x20050030, "E1", 1, "",
- "Determines whether the time pulse length is interpreted as "
- "length[us] or pulse ratio[%]?"),
- ("CFG-TP-ANT_CABLEDELAY", 0x30050001, "I2", 0.000000001, "s",
- "Antenna cable delay"),
- ("CFG-TP-PERIOD_TP1", 0x40050002, "U4", 0.000001, "s",
- "Time pulse period (TP1)"),
- ("CFG-TP-PERIOD_LOCK_TP1", 0x40050003, "U4", 0.000001, "s",
- "Time pulse period when locked to GNSS time (TP1)"),
- ("CFG-TP-FREQ_TP1", 0x40050024, "U4", 1, "Hz",
- "Time pulse frequency (TP1)"),
- ("CFG-TP-FREQ_LOCK_TP1", 0x40050025, "U4", 1, "Hz",
- "Time pulse frequency when locked to GNSS time (TP1)"),
- ("CFG-TP-LEN_TP1", 0x40050004, "U4", 0.000001, "s",
- "Time pulse length (TP1)"),
- ("CFG-TP-LEN_LOCK_TP1", 0x40050005, "U4", 0.000001, "s",
- "Time pulse length when locked to GNSS time (TP1)"),
- ("CFG-TP-DUTY_TP1", 0x5005002a, "R8", 1, "%",
- "Time pulse duty cycle (TP1)"),
- ("CFG-TP-DUTY_LOCK_TP1", 0x5005002b, "R8", 1, "%",
- "Time pulse duty cycle when locked to GNSS time (TP1)"),
- ("CFG-TP-USER_DELAY_TP1", 0x40050006, "I4", 0.000000001, "s",
- "User configurable time pulse delay (TP1)"),
- ("CFG-TP-TP1_ENA", 0x10050007, "L", 1, "",
- "Enable the first timepulse"),
- ("CFG-TP-SYNC_GNSS_TP1", 0x10050008, "L", 1, "",
- "Sync time pulse to GNSS time or local clock (TP1)"),
- ("CFG-TP-USE_LOCKED_TP1", 0x10050009, "L", 1, "",
- "Use locked parameters when possible (TP1)"),
- ("CFG-TP-ALIGN_TO_TOW_TP1", 0x1005000a, "L", 1, "",
- "Align time pulse to top of second (TP1)"),
- ("CFG-TP-POL_TP1", 0x1005000b, "L", 1, "",
- "Set time pulse polarity (TP1)"),
- ("CFG-TP-TIMEGRID_TP1", 0x2005000c, "E1", 1, "",
- "Time grid to use (TP1)"),
- ("CFG-TP-PERIOD_TP2", 0x4005000d, "U4", 0.000001, "s",
- "Time pulse period (TP2)"),
- ("CFG-TP-PERIOD_LOCK_TP2", 0x4005000e, "U4", 0.000001, "s",
- "Time pulse period when locked to GNSS time (TP2)"),
- ("CFG-TP-FREQ_TP2", 0x40050026, "U4", 1, "Hz",
- "Time pulse frequency (TP2)"),
- ("CFG-TP-FREQ_LOCK_TP2", 0x40050027, "U4", 1, "Hz",
- "Time pulse frequency when locked to GNSS time (TP2)"),
- ("CFG-TP-LEN_TP2", 0x4005000f, "U4", 0.000001, "s",
- "Time pulse length (TP2)"),
- ("CFG-TP-LEN_LOCK_TP2", 0x40050010, "U4", 0.000001, "s",
- "Time pulse length when locked to GNSS time (TP2)"),
- ("CFG-TP-DUTY_TP2", 0x5005002c, "R8", 1, "%",
- "Time pulse duty cycle (TP2)"),
- ("CFG-TP-DUTY_LOCK_TP2", 0x5005002d, "R8", 1, "%",
- "Time pulse duty cycle when locked to GNSS time (TP2)"),
- ("CFG-TP-USER_DELAY_TP2", 0x40050011, "I4", 0.000000001, "s",
- "User configurable time pulse delay (TP2)"),
- ("CFG-TP-TP2_ENA", 0x10050012, "L", 1, "",
- "Enable the second timepulse"),
- ("CFG-TP-SYNC_GNSS_TP2", 0x10050013, "L", 1, "",
- "Sync time pulse to GNSS time or local clock (TP2)"),
- ("CFG-TP-USE_LOCKED_TP2", 0x10050014, "L", 1, "",
- "Use locked parameters when possible (TP2)"),
- ("CFG-TP-ALIGN_TO_TOW_TP2", 0x10050015, "L", 1, "",
- "Align time pulse to top of second (TP2)"),
- ("CFG-TP-POL_TP2", 0x10050016, "L", 1, "",
- "Set time pulse polarity (TP2)"),
- ("CFG-TP-TIMEGRID_TP2", 0x20050017, "E1", 1, "",
- "Time grid to use (TP2)"),
-
- ("CFG-TXREADY", 0x10a2ffff, "", 0, "",
- "get all CFG-TXREADY"),
- ("CFG-TXREADY-ENABLED", 0x10a20001, "L", 1, "",
- "Flag to indicate if tx ready pin mechanism should be enabled"),
- ("CFG-TXREADY-POLARITY", 0x10a20002, "L", 1, "",
- "Polarity of the tx ready pin:false:high-active, true:low-active"),
- ("CFG-TXREADY-PIN", 0x20a20003, "U1", 1, "",
- "Pin number to use for the tx ready functionality"),
- ("CFG-TXREADY-THRESHOLD", 0x30a20004, "U2", 1, "",
- "Amount of data ready on interface before triggering tx ready pin"),
- ("CFG-TXREADY-INTERFACE", 0x20a20005, "E1", 1, "",
- "Interface where the tx ready feature should be linked to"),
-
- ("CFG-UART1", 0x4052ffff, "", 0, "",
- "get all CFG-UART1"),
- ("CFG-UART1-BAUDRATE", 0x40520001, "U4", 1, "",
- "The baud rate that should be configured on the UART1"),
- ("CFG-UART1-STOPBITS", 0x20520002, "E1", 1, "",
- "Number of stopbits that should be used on UART1"),
- ("CFG-UART1-DATABITS", 0x20520003, "E1", 1, "",
- "Number of databits that should be used on UART1"),
- ("CFG-UART1-PARITY", 0x20520004, "E1", 1, "",
- "Parity mode that should be used on UART1"),
- ("CFG-UART1-ENABLED", 0x10520005, "L", 1, "",
- "Flag to indicate if the UART1 should be enabled"),
-
- ("CFG-UART1INPROT", 0x1073ffff, "", 0, "",
- "get all CFG-UART1INPROT"),
- ("CFG-UART1INPROT-UBX", 0x10730001, "L", 1, "",
- "Flag to indicate if UBX should be an input protocol on UART1"),
- ("CFG-UART1INPROT-NMEA", 0x10730002, "L", 1, "",
- "Flag to indicate if NMEA should be an input protocol on UART1"),
- ("CFG-UART1INPROT-RTCM2X", 0x10730003, "L", 1, "",
- "Flag to indicate if RTCM2X should be an input protocol on UART1"),
- ("CFG-UART1INPROT-RTCM3X", 0x10730004, "L", 1, "",
- "Flag to indicate if RTCM3X should be an input protocol on UART1"),
-
- ("CFG-UART1OUTPROT", 0x1074ffff, "", 0, "",
- "get all CFG-UART1OUTPROT"),
- ("CFG-UART1OUTPROT-UBX", 0x10740001, "L", 1, "",
- "Flag to indicate if UBX should be an output protocol on UART1"),
- ("CFG-UART1OUTPROT-NMEA", 0x10740002, "L", 1, "",
- "Flag to indicate if NMEA should be an output protocol on UART1"),
- ("CFG-UART1OUTPROT-RTCM3X", 0x10740004, "L", 1, "",
- "Flag to indicate if RTCM3X should be an output protocol on UART1"),
-
- ("CFG-UART2", 0x4053FFFF, "", 0, "",
- "get all CFG-UART2"),
- ("CFG-UART2-BAUDRATE", 0x40530001, "U4", 1, "",
- "The baud rate that should be configured on the UART2"),
- ("CFG-UART2-STOPBITS", 0x20530002, "E1", 1, "",
- "Number of stopbits that should be used on UART2"),
- ("CFG-UART2-DATABITS", 0x20530003, "E1", "1", "",
- "Number of databits that should be used on UART2"),
- ("CFG-UART2-PARITY", 0x20530004, "E1", "1", "",
- "Parity mode that should be used on UART2"),
- ("CFG-UART2-ENABLED", 0x10530005, "L", "1", "",
- "Flag to indicate if the UART2 should be enabled"),
- ("CFG-UART2-REMAP", 0x10530006, "L", "1", "",
- "UART2 Remapping"),
-
- ("CFG-UART2INPROT", 0x1075ffff, "", 0, "",
- "get all CFG-UART2INPROT"),
- ("CFG-UART2INPROT-UBX", 0x10750001, "L", 1, "",
- "Flag to indicate if UBX should be an input protocol on UART2"),
- ("CFG-UART2INPROT-NMEA", 0x10750002, "L", 1, "",
- "Flag to indicate if NMEA should be an input protocol on UART2"),
- ("CFG-UART2INPROT-RTCM2X", 0x10750003, "L", 1, "",
- "Flag to indicate if RTCM2X should be an input protocol on UART2"),
- ("CFG-UART2INPROT-RTCM3X", 0x10750004, "L", 1, "",
- "Flag to indicate if RTCM3X should be an input protocol on UART2"),
-
- ("CFG-UART2OUTPROT", 0x1076ffff, "", 0, "",
- "get all CFG-UART2OUTPROT"),
- ("CFG-UART2OUTPROT-UBX", 0x10760001, "L", 1, "",
- "Flag to indicate if UBX should be an output protocol on UART2"),
- ("CFG-UART2OUTPROT-NMEA", 0x10760002, "L", 1, "",
- "Flag to indicate if NMEA should be an output protocol on UART2"),
- ("CFG-UART2OUTPROT-RTCM3X", 0x10760004, "L", 1, "",
- "Flag to indicate if RTCM3X should be an output protocol on UART2"),
-
- ("CFG-USB", 0x1065ffff, "", 0, "",
- "get all CFG-USB"),
- ("CFG-USB-ENABLED", 0x10650001, "L", 1, "",
- "Flag to indicate if the USB interface should be enabled"),
- ("CFG-USB-SELFPOW", 0x10650002, "L", 1, "",
- "Self-Powered device"),
- ("CFG-USB-VENDOR_ID", 0x3065000a, "U2", 1, "",
- "Vendor ID"),
- ("CFG-USB-PRODUCT_ID", 0x3065000b, "U2", 1, "",
- "Product ID"),
- ("CFG-USB-POWER", 0x3065000c, "U2", 1, "mA",
- "Power consumption"),
- ("CFG-USB-VENDOR_STR0", 0x5065000d, "X8", 1, "",
- "Vendor string characters 0-7"),
- ("CFG-USB-VENDOR_STR1", 0x5065000e, "X8", 1, "",
- "Vendor string characters 8-15"),
- ("CFG-USB-VENDOR_STR2", 0x5065000f, "X8", 1, "",
- "Vendor string characters 16-23"),
- ("CFG-USB-VENDOR_STR3", 0x50650010, "X8", 1, "",
- "Vendor string characters 24-31"),
- ("CFG-USB-PRODUCT_STR0", 0x50650011, "X8", 1, "",
- "Product string characters 0-7"),
- ("CFG-USB-PRODUCT_STR1", 0x50650012, "X8", 1, "",
- "Product string characters 8-15"),
- ("CFG-USB-PRODUCT_STR2", 0x50650013, "X8", 1, "",
- "Product string characters 16-23"),
- ("CFG-USB-PRODUCT_STR3", 0x50650014, "X8", 1, "",
- "Product string characters 24-31"),
- ("CFG-USB-SERIAL_NO_STR0", 0x50650015, "X8", 1, "",
- "Serial number string characters 0-7"),
- ("CFG-USB-SERIAL_NO_STR1", 0x50650016, "X8", 1, "",
- "Serial number string characters 8-15"),
- ("CFG-USB-SERIAL_NO_STR2", 0x50650017, "X8", 1, "",
- "Serial number string characters 16-23"),
- ("CFG-USB-SERIAL_NO_STR3", 0x50650018, "X8", 1, "",
- "Serial number string characters 24-31"),
-
- ("CFG-USBINPROT", 0x1077ffff, "", 0, "",
- "get all CFG-USBINPROT"),
- ("CFG-USBINPROT-UBX", 0x10770001, "L", 1, "",
- "Flag to indicate if UBX should be an input protocol on USB"),
- ("CFG-USBINPROT-NMEA", 0x10770002, "L", 1, "",
- "Flag to indicate if NMEA should be an input protocol on USB"),
- ("CFG-USBINPROT-RTCM2X", 0x10770003, "L", 1, "",
- "Flag to indicate if RTCM2X should be an input protocol on USB"),
- ("CFG-USBINPROT-RTCM3X", 0x10770004, "L", 1, "",
- "Flag to indicate if RTCM3X should be an input protocol on USB"),
-
- ("CFG-USBOUTPROT", 0x1078ffff, "", 0, "",
- "get all CFG-USBOUTPROT"),
- ("CFG-USBOUTPROT-UBX", 0x10780001, "L", 1, "",
- "Flag to indicate if UBX should be an output protocol on USB"),
- ("CFG-USBOUTPROT-NMEA", 0x10780002, "L", 1, "",
- "Flag to indicate if NMEA should be an output protocol on USB"),
- ("CFG-USBOUTPROT-RTCM3X", 0x10780004, "L", 1, "",
- "Flag to indicate if RTCM3X should be an output protocol on USB"),
- )
- def item_to_type(self, item):
- """Return (size, pack format, i/i/f) for item"""
-
- cfg_types = {
- "E1": (1, "<B", "u"),
- "E2": (2, "<H", "u"),
- "E4": (4, "<L", "u"),
- "I1": (1, "<b", "i"),
- "I2": (2, "<h", "i"),
- "I4": (4, "<l", "i"),
- "I8": (8, "<q", "i"),
- "L": (1, "<B", "u"),
- "R4": (4, "<f", "f"),
- "R8": (8, "<d", "f"),
- "U1": (1, "<B", "u"),
- "U2": (2, "<H", "u"),
- "U4": (4, "<L", "u"),
- "U8": (8, "<Q", "u"),
- "X1": (1, "<B", "u"),
- "X2": (2, "<H", "u"),
- "X4": (4, "<L", "u"),
- "X8": (8, "<Q", "u"),
- }
-
- key_map = {0: (1, "<B", "u"),
- 1: (1, "<B", "u"),
- 2: (1, "<B", "u"),
- 3: (2, "<H", "u"),
- 4: (4, "<L", "u"),
- 5: (8, "<B", "u"),
- 6: (1, "<B", "u"),
- 7: (1, "<B", "u"),
- }
- key = item[1]
- val_type = item[2]
- if val_type in cfg_types:
- cfg_type = cfg_types[val_type]
- else:
-
- key_size = (key >> 28) & 0x07
- cfg_type = key_map[key_size]
- return cfg_type
- cfg_by_key_group = {0x03: "TMODE",
- 0x05: "TP",
- 0x11: "NAVSPG",
- 0x14: "NAVHPG",
- 0x21: "RATE",
- 0x22: "ODO",
- 0x23: "ANA",
- 0x24: "GEOFENCE",
- 0x25: "MOT",
- 0x26: "BATCH",
- 0x31: "SIGNAL",
- 0x37: "QZSS",
- 0x41: "ITFM",
- 0x51: "I2C",
- 0x52: "UART1",
- 0x53: "UART2",
- 0x64: "SPI",
- 0x65: "USB",
- 0x71: "I2CINPROT",
- 0x72: "I2COUTPROT",
- 0x73: "UART1INPROT",
- 0x74: "UART1OUTPROT",
- 0x75: "UART2INPROT",
- 0x76: "UART2OUTPROT",
- 0x77: "USBOUTPROT",
- 0x78: "USBOUTPROT",
- 0x79: "SPIINPROT",
- 0x7a: "SPIOUTPROT",
- 0x91: "MSGOUT",
- 0x92: "INFMSG",
- 0x93: "NMEA",
- 0xa2: "TXREADY",
- 0xa3: "HW",
- 0xc7: "RINV",
- 0xd0: "PM",
- 0xde: "LOGFILTER",
- }
- cfg_by_key_kmap = {0: "Z0",
- 1: "L",
- 2: "U1",
- 3: "U2",
- 4: "U4",
- 5: "U8",
- 6: "Z6",
- 7: "Z7",
- }
- def cfg_by_key(self, key):
- """Find a config item by key"""
- for item in self.cfgs:
- if item[1] == key:
- return item
-
- group = (key >> 16) & 0xff
- group_name = index_s(group, self.cfg_by_key_group)
- if "Unk" == group_name:
- group_name = str(group)
- name = "CFG-%s-%u" % (group_name, key & 0xff)
- size = (key >> 28) & 0x07
- item = (name, key, self.cfg_by_key_kmap[size], 1, "Unk", "Unknown")
- return item
- def cfg_by_name(self, name):
- """Find a config item by name"""
- for item in self.cfgs:
- if item[0] == name:
- return item
- return None
- id_map = {
- 0: {"name": "GPS",
- "sig": {0: "L1C/A", 3: "L2 CL", 4: "L2 CM"}},
- 1: {"name": "SBAS",
- "sig": {0: "L1C/A", 3: "L2 CL", 4: "L2 CM"}},
- 2: {"name": "Galileo",
- "sig": {0: "E1C", 1: "E1 B", 5: "E5 bl", 6: "E5 bQ"}},
- 3: {"name": "BeiDou",
- "sig": {0: "B1I D1", 1: "B1I D2", 2: "B2I D1", 3: "B2I D2"}},
- 4: {"name": "IMES",
- "sig": {0: "L1C/A", 3: "L2 CL", 4: "L2 CM"}},
- 5: {"name": "QZSS",
- "sig": {0: "L1C/A", 4: "L2 CM", 5: "L2 CL"}},
- 6: {"name": "GLONASS",
- "sig": {0: "L1 OF", 2: "L2 OF"}},
- }
- def gnss_s(self, gnssId, svId, sigId):
- """Verbose decode of gnssId, svId and sigId"""
- s = ''
- if gnssId in self.id_map:
- if "name" not in self.id_map[gnssId]:
- s = "%d:%d:%d" % (gnssId, svId, sigId)
- elif sigId not in self.id_map[gnssId]["sig"]:
- s = ("%s:%d:%d" %
- (self.id_map[gnssId]["name"], svId, sigId))
- else:
- s = ("%s:%d:%s" %
- (self.id_map[gnssId]["name"], svId,
- self.id_map[gnssId]["sig"][sigId]))
- else:
- s = "%d:%d:%d" % (gnssId, svId, sigId)
- return s
- def ack_ack(self, buf):
- """UBX-ACK-ACK decode"""
-
- u = struct.unpack_from('<BB', buf, 0)
- return ' ACK to %s' % self.class_id_s(u[0], u[1])
- def ack_nak(self, buf):
- """UBX-ACK-NAK decode"""
-
- u = struct.unpack_from('<BB', buf, 0)
- return ' NAK to %s' % self.class_id_s(u[0], u[1])
-
- ack_ids = {0: {'str': 'NAK', 'dec': ack_nak, 'minlen': 2,
- 'name': 'UBX-ACK-NAK'},
- 1: {'str': 'ACK', 'dec': ack_ack, 'minlen': 2,
- 'name': 'UBX-ACK-ACK'}}
-
- def aid_alm(self, buf):
- """UBX-AID-ALM decode, GPS Aiding Almanac Data"""
- m_len = len(buf)
- if 1 == m_len:
- return " Poll request svid %u" % buf[0]
- if 8 > m_len:
- return " Bad Length %s" % m_len
- u = struct.unpack_from('<LL', buf, 0)
- s = ' svid %u week %u ' % u
- if 0 != u[1] and 8 < m_len <= 40:
- u = struct.unpack_from('<LLLLLLLL', buf, 8)
- s += ('\n dwrd %08x %08x %08x %08x'
- '\n %08x %08x %08x %08x' % u)
- return s
- def aid_alp(self, buf):
- """UBX-AID-ALP decode, AlmanacPlus"""
-
- m_len = len(buf)
- if 1 == m_len(buf):
-
- u = struct.unpack_from('<B', buf, 0)
- return ' dummy/ack %u' % u
- if 24 == m_len(buf):
-
- u = struct.unpack_from('LLlHHLBBH', buf, 0)
- return (' predTow %u predDur %u age %d predWno %u almWno %u\n'
- ' res1 %u svs %u res23 %u %u' % u)
-
- s = ' alpData len %u' % u
-
- return s
- def aid_alpsrv(self, buf):
- """UBX-AID-ALPSRV decode, AlmanacPlus"""
-
- u = struct.unpack_from('<BBHHH', buf, 0)
- s = ' idSize %u type %u ofx %u size %u fileId %u' % u
-
- return s
- def aid_aop(self, buf):
- """UBX-AID-AOP decode, AssistNow Autonomous data"""
- m_len = len(buf)
- if 1 == m_len:
- return " Poll request svid %u" % buf[0]
-
- if 2 > m_len:
- return " Bad Length %s" % m_len
- u = struct.unpack_from('<BB', buf, 0)
- s = ' gnssid %u svid %u' % u
-
- return s
- def aid_data(self, buf):
- """UBX-AID-DATA decode, Poll all GPS Initial Aiding Data"""
-
-
-
- return " Poll all GPS Initial Aiding Data"
- def aid_eph(self, buf):
- """UBX-AID-EPH decode, GPS Aiding Ephemeris Data"""
- m_len = len(buf)
- if 1 == m_len:
- return " Poll request svid %u" % buf[0]
- if 8 > m_len:
- return " Bad Length %s" % m_len
- u = struct.unpack_from('<LL', buf, 0)
- s = ' svid %u how x%x ' % u
- if 0 != u[1] and 8 < m_len <= 104:
- u = struct.unpack_from('<LLLLLLLLLLLLLLLLLLLLLLLL', buf, 8)
- s += ('\n sf1d %08x %08x %08x %08x'
- '\n %08x %08x %08x %08x'
- '\n sf2d %08x %08x %08x %08x'
- '\n %08x %08x %08x %08x'
- '\n sf3d %08x %08x %08x %08x'
- '\n %08x %08x %08x %08x' % u)
- return s
- def aid_hui(self, buf):
- """UBX-AID-HUI decode, GPS Heatlh, UTC, Ionosphere"""
- u = struct.unpack_from('<LddlhhhhhhffffffffL', buf, 0)
- s = (' health x%x utcA0 %e utcA1 %e utcTOW %d'
- '\n utcWNT %d utcLS %d utcWNF %d utcDN %d utcLSF %d utcSpare %d'
- '\n klobA0 %e klobA1 %e klobA2 %e'
- '\n klobA3 %e klobB0 %e klobB1 %e'
- '\n klobB2 %e klobB3 %e flags x%x' % u)
- return s
- def aid_ini(self, buf):
- """UBX-AID-INI decode, Aiding position, time, frequency, clock drift"""
- u = struct.unpack_from('<lllLHHLlLLlLL', buf, 0)
- s = (' ecefXOrLat %d ecefYOrLon %d ecefZOrAlt %d posAcc %u'
- '\n tmCfg x%x wnoOrDate %u towOrTime %u towNs %d'
- '\n tAccMs %u tAccNs %u clkDOrFreq %d clkDAccOrFreqAcc %u'
- '\n flags x%x' % u)
- return s
- def aid_req(self, buf):
- """UBX-AID-REQ decode, Sends a poll for all GPS Aiding Data"""
- return " poll (AID-DATA) for all GPS Aiding Data"
-
- aid_ids = {
-
- 0x00: {'str': 'REQ', 'dec': aid_req, 'minlen': 0,
- 'name': 'UBX-AID-REQ'},
- 0x01: {'str': 'INI', 'dec': aid_ini, 'minlen': 48,
- 'name': 'UBX-AID-INI'},
- 0x02: {'str': 'HUI', 'dec': aid_hui, 'minlen': 72,
- 'name': 'UBX-AID-HUI'},
-
- 0x10: {'str': 'DATA', 'dec': aid_data, 'minlen': 0,
- 'name': 'UBX-AID-DATA'},
- 0x30: {'str': 'ALM', 'dec': aid_alm, 'minlen': 1,
- 'name': 'UBX-AID-ALM'},
- 0x31: {'str': 'EPH', 'dec': aid_eph, 'minlen': 1,
- 'name': 'UBX-AID-EPH'},
-
- 0x32: {'str': 'ALPSRV', 'dec': aid_alpsrv, 'minlen': 8,
- 'name': 'UBX-AID-ALPSRV'},
- 0x33: {'str': 'AOP', 'dec': aid_aop, 'minlen': 1,
- 'name': 'UBX-AID-AOP'},
- 0x50: {'str': 'ALP', 'dec': aid_alp, 'minlen': 1,
- 'name': 'UBX-AID-ALP'},
- }
- cfg_ant_pins = {
- 1: 'svcs',
- 2: 'scd',
- 4: 'ocd',
- 8: 'pdwnOnSCD',
- 0x10: 'recovery',
- }
- def cfg_ant(self, buf):
- """UBX-CFG-ANT decode"""
- u = struct.unpack_from('<HH', buf, 0)
- s = ' flags x%x pins x%x ' % u
- s += ('pinSwitch %u pinSCD %u pinOCD %u reconfig %u' %
- (u[1] & 0x1f, (u[1] >> 5) & 0x1f, (u[1] >> 10) & 0x1f,
- u[1] >> 15))
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n flags (%s)' % flag_s(u[0], self.cfg_ant_pins))
- return s
- cfg_batch_flags = {
- 1: 'enable',
- 4: 'extraPvt',
- 8: 'extraOdo',
- 0x20: 'pioEnable',
- 0x40: 'pioActiveLow',
- }
- def cfg_batch(self, buf):
- """UBX-CFG-BATCH decode"""
- u = struct.unpack_from('<BBHHBB', buf, 0)
- s = (" version %u flags x%x bufsize %u notifThrs %u\n"
- " pioId %u reserved1 %u" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n flags (%s)' % flag_s(u[1], self.cfg_batch_flags))
- return s
- cfg_cfg_mask = {
- 0x1: 'ioPort',
- 0x2: 'msgConf',
- 0x4: 'infMsg',
- 0x8: 'navConf',
- 0x10: 'rxmConf',
- 0x100: 'senConf',
- 0x200: 'rinvConf',
- 0x400: 'antConf',
- 0x800: 'logConf',
- 0x1000: 'ftsConf',
- }
- cfg_cfg_dev = {
- 0x1: 'devBBR',
- 0x2: 'devFlash',
- 0x4: 'devEEPROM',
- 0x10: 'devSpiFlash',
- }
- def cfg_cfg(self, buf):
- """UBX-CFG-CFG decode"""
- m_len = len(buf)
- if 12 == m_len:
- u = struct.unpack_from('<LLL', buf, 0)
- else:
- u = struct.unpack_from('<LLLB', buf, 0)
- s = (' clearMask: %#x (%s)\n' %
- (u[0], flag_s(u[0], self.cfg_cfg_mask)))
- s += (' saveMask: %#x (%s)\n' %
- (u[1], flag_s(u[1], self.cfg_cfg_mask)))
- s += (' loadMask: %#x (%s)\n' %
- (u[2], flag_s(u[2], self.cfg_cfg_mask)))
- if 13 <= m_len:
- s += (' deviceMask: %#x (%s)\n' %
- (u[3], flag_s(u[3], self.cfg_cfg_dev)))
- return s
- def cfg_dat(self, buf):
- """UBX-CFG-DAT decode, Standard Datum configuration"""
-
- m_len = len(buf)
- if 2 == m_len:
-
- u = struct.unpack_from('<H', buf, 0)
- s = " datumNum %u" % u
- elif 44 > m_len:
- s = " Bad Length %d" % m_len
- elif 44 == m_len:
-
- u = struct.unpack_from('<ddfffffff', buf, 0)
- s = (" majA %.1f flat %.1f dX %.1f dY %.1f dZ %.1f\n"
- " rotX %.1f rotY %.1f rotZ %.1f scale %.1f" % u)
- elif 52 > m_len:
- s = " Bad Length %d" % m_len
- elif 52 <= m_len:
-
- u = struct.unpack_from('<HBBBBBBddfffffff', buf, 0)
- s = (" datumNum %u datumNam %u %u %u %u %u %u\n"
- " majA %.1f flat %.1f dX %.1f dY %.1f dZ %.1f\n"
- " rotX %.1f rotY %.1f rotZ %.1f scale %.1f" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n datumName (%s)' %
- gps.polystr(buf[2:8]).rstrip('\0'))
- else:
- s = "I'm confused..."
- return s
- cfg_dgnss_mode = {
- 2: "RTK Float",
- 3: "RTK Fixed",
- }
- def cfg_dgnss(self, buf):
- """UBX-CFG-DGNSS decode, DGNSS configuration"""
- u = struct.unpack_from('<BBBB', buf, 0)
- s = (" dgnssMode %u (%s) reserved1 %u %u %u" % u
- (u[0], index_s(u[0], self.cfg_dgnss_mode), u[1], u[2], u[3]))
- return s
- def cfg_dosc(self, buf):
- """UBX-CFG-DOSC decode, Disciplined oscillator configuration"""
- u = struct.unpack_from('<BBBB', buf, 0)
- s = " version %u numOsc %u reserved1 %u" % u
-
- return s
- def cfg_dynseed(self, buf):
- """UBX-CFG-DYNSEED decode,
- Programming the dynamic seed for host interface signature"""
-
- u = struct.unpack_from('<BBHLL', buf, 0)
- s = " version %u reserved1 %u %u seedHi %u seedLo %u" % u
- return s
- def cfg_esrc(self, buf):
- """UBX-CFG-ESRC decode, External synchronization source
- configuration"""
- u = struct.unpack_from('<BBBB', buf, 0)
- s = " version %u numSources %u reserved1 %u" % u
-
- return s
- def cfg_fixseed(self, buf):
- """UBX-CFG-FIXSEED decode,
- Programming the fixed seed for host interface signature"""
-
- u = struct.unpack_from('<BBHLL', buf, 0)
- s = " version %u length %u reserved1 %u seedHi %u seedLo %u" % u
-
- return s
- cfg_fxn_flags = {
- 2: "sleep Float",
- 8: "absAlign",
- 0x10: "onOff",
- }
- def cfg_fxn(self, buf):
- """UBX-CFG-FXN decode, FXN FixNOW configuration"""
-
- u = struct.unpack_from('<LLLLLLLLL', buf, 0)
- s = (" flags x%x tReacq %u tAcq %u tReacqOff %u\n"
- " tAcqOff %u tOn %u tOff %u res %u baseTow %u\n" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n flags (%s)" %
- (flag_s(u[0], self.cfg_fxn_flags)))
- return s
- def cfg_geofence(self, buf):
- """UBX-CFG-GEOFENCE decode, Geofencing configuration"""
- u = struct.unpack_from('<BBBBBBBB', buf, 0)
- s = (" version %u numFences %u confLvl %u reserved1 %u\n"
- " pioEnabled %u pinPolarity %u pin %u reserved2 %u" % u)
- for i in range(0, u[1]):
- u = struct.unpack_from('<llL', buf, 8 + (i * 12))
- s = "\n lat %d lon %d radius %d" % u
- return s
-
-
-
- cfg_gnss_sig = {
- 0: {0x010000: "L1C/A",
- 0x100000: "L2C"},
- 1: {0x010000: "L1C/A"},
- 2: {0x010000: "E1",
- 0x200000: "E5b"},
- 3: {0x010000: "B1I",
- 0x100000: "B2I"},
- 4: {0x010000: "L1"},
- 5: {0x010000: "L1C/A",
- 0x040000: "L1S",
- 0x100000: "L2C"},
- 6: {0x010000: "L1",
- 0x100000: "L2"},
- }
- def cfg_gnss(self, buf):
- """UBX-CFG-GNSS decode, GNSS system configuration"""
- u = struct.unpack_from('<BBBB', buf, 0)
- s = " msgVer %u numTrkChHw %u numTrkChUse %u numConfigBlocks %u" % u
- for i in range(0, u[3]):
- u = struct.unpack_from('<BBBBL', buf, 4 + (i * 8))
- sat = u[0]
- s += ("\n gnssId %u TrkCh %2u maxTrCh %2u reserved %u "
- "Flags x%08x\n" % u)
- if 7 > sat:
- s += (" %s %s " %
- (index_s(sat, self.gnss_id),
- flag_s(u[4], self.cfg_gnss_sig[sat])))
- else:
- s += "Unk "
- if u[4] & 0x01:
- s += 'enabled'
- return s
- def cfg_hnr(self, buf):
- """UBX-CFG-HNR decode, High Navigation Rate Settings"""
- u = struct.unpack_from('<BBBb', buf, 0)
- s = " highNavRate %u reserved %u %u %u" % u
- return s
- cfg_inf_protid = {
- 0: "UBX",
- 1: "NMEA",
- 3: "Unk3",
- 12: "Unk12",
- 13: "Unk13",
- 14: "Unk14",
- 15: "Unk15",
- }
- def cfg_inf(self, buf):
- """UBX-CFG-INF decode, Poll configuration for one protocol"""
- m_len = len(buf)
- if 1 == m_len:
- return (" Poll request: %s" %
- index_s(buf[0], self.cfg_inf_protid))
- if 10 < m_len:
- return " Bad Length %d" % m_len
- u = struct.unpack_from('<BBBBBBBBBB', buf, 0)
- s = (" protocolId %u reserved1 %u %u %u\n"
- " infMsgMask %u %u %u %u %u %u" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n protocolId (%s)' %
- index_s(buf[0], self.cfg_inf_protid))
- return s
- cfg_itfm_config = {
- 0x80000000: "enable",
- }
- cfg_itfm_config2 = {
- 0x4000: "enable2",
- }
- cfg_itfm_ant = {
- 1: "passive",
- 2: "active",
- }
- def cfg_itfm(self, buf):
- """UBX-CFG-ITFM decode, Jamming/Interference Monitor configuration"""
- u = struct.unpack_from('<LL', buf, 0)
- s = " config x%x config2 x%x" % u
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n config (%s) bbThreshold %u cwThreshold %u "
- "algorithmBits x%x"
- "\n config2 (%s) generalBits x%x antSetting (%s)" %
- (flag_s(buf[0], self.cfg_itfm_config),
- u[0] & 0x0f, (u[0] >> 4) & 0x1f, (u[0] >> 9) & 0x1fffff,
- flag_s(buf[1], self.cfg_itfm_config2),
- u[1] & 0x0fff,
- index_s((u[1] >> 12) & 3, self.cfg_itfm_config2)))
- return s
- cfg_logfilter_flags = {
- 1: "recordEnabled",
- 2: "psmOncePerWakupEnabled",
- 4: "applyAllFilterSettings",
- }
- def cfg_logfilter(self, buf):
- """UBX-CFG-LOGFILTER decode, Data Logger Configuration"""
-
- u = struct.unpack_from('<BBHHHL', buf, 0)
- s = (" version %u flags x%x minInterval %u timeThreshold %u\n"
- " speedThreshold %u positionThreshold %u" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n flags (%s)" %
- (flag_s(buf[1], self.cfg_logfilter_flags)))
- return s
- utc_std = {
- 0: "Default",
- 1: "CRL",
- 2: "NIST",
- 3: "USNO",
- 4: "BIPM",
- 5: "tbd",
- 6: "SU",
- 7: "NTSC",
- }
- cfg_nav5_dyn = {
- 0: "Portable",
- 2: "Stationary",
- 3: "Pedestrian",
- 4: "Automotive",
- 5: "Sea",
- 6: "Airborne with <1g Acceleration",
- 7: "Airborne with <2g Acceleration",
- 8: "Airborne with <4g Acceleration",
- }
- cfg_nav5_fix = {
- 1: "2D only",
- 2: "3D only",
- 3: "Auto 2D/3D",
- }
- cfg_nav5_mask = {
- 1: "dyn",
- 2: "minEl",
- 4: "posFixMode",
- 8: "drLim",
- 0x10: "posMask",
- 0x20: "timeMask",
- 0x40: "staticHoldMask",
- 0x80: "dgpsMask",
- 0x100: "cnoThreshold",
- 0x400: "utc",
- }
- def cfg_nav5(self, buf):
- """UBX-CFG-NAV5 nav Engine Settings"""
- u = struct.unpack_from('<HBBlLbBHHHHbbbbHHbBL', buf, 0)
- s = (' mask %#x dynModel %u fixmode %d fixedAlt %d FixedAltVar %u\n'
- ' minElev %d drLimit %u pDop %u tDop %u pAcc %u tAcc %u\n'
- ' staticHoldThresh %u dgpsTimeOut %u cnoThreshNumSVs %u\n'
- ' cnoThresh %u res %u staticHoldMaxDist %u utcStandard %u\n'
- ' reserved x%x %x' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n dynModel (%s) fixMode (%s) utcStandard (%s)"
- "\n mask (%s)" %
- (index_s(u[1], self.cfg_nav5_dyn),
- index_s(u[2], self.cfg_nav5_fix),
- index_s(u[17] >> 4, self.utc_std),
- flag_s(u[0] >> 4, self.cfg_nav5_mask)))
- return s
- cfg_navx5_mask1 = {
- 4: "minMax",
- 8: "minCno",
- 0x40: "initial3dfix",
- 0x200: "wknRoll",
- 0x400: "ackAid",
- 0x2000: "ppp",
- 0x4000: "aop",
- }
- cfg_navx5_mask2 = {
- 0x40: "adr",
- 0x80: "sigAttenComp",
- }
- cfg_navx5_aop = {
- 1: "useAOP",
- }
- def cfg_navx5(self, buf):
- """UBX-CFG-NAVX5 decode, Navigation Engine Expert Settings"""
-
-
- m_len = len(buf)
- u = struct.unpack_from('<HHLHBBBBBHBH', buf, 0)
- s = (" version %u mask1 x%x mask2 x%x reserved1 %u minSVs %u "
- "maxSVs %u minCNO %u\n"
- " reserved2 %u iniFix3D %u reserved3 %u ackAiding %u "
- "wknRollover %u" % u)
-
- if 40 <= m_len:
- u1 = struct.unpack_from('<BBHHBBHHLHBB', buf, 20)
- s += ("\n sigAttenCompMode %u reserved456 %u %u %u usePPP %u "
- "aopCfg %u reserved7 %u"
- "\n aopOrbMaxErr %u reserved89 %u %u %u useAdr %u" % u1)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n mask1 (%s)"
- "\n mask2 (%s) aopCfg (%s)" %
- (flag_s(u[1], self.cfg_navx5_mask1),
- flag_s(u[2], self.cfg_navx5_mask2),
- flag_s(u1[5], self.cfg_navx5_aop)))
- return s
- def cfg_msg(self, buf):
- """UBX-CFG-MSG decode"""
- m_len = len(buf)
- if 2 == m_len:
- u = struct.unpack_from('<BB', buf, 0)
- return ' Rate request %s' % self.class_id_s(u[0], u[1])
- if 3 == m_len:
- u = struct.unpack_from('<BBB', buf, 0)
- return (' Rate set %s Rate %d' %
- (self.class_id_s(u[0], u[1]), u[2]))
- if 8 != m_len:
- return " Bad Length %s" % m_len
- u = struct.unpack_from('<BBBBBBBB', buf, 0)
- s = (' %s Rates %u %u %u %u %u %u' %
- (self.class_id_s(u[0], u[1]), u[2], u[3], u[4], u[5], u[6], u[7]))
- return s
- cfg_nmea_filter = {
- 1: "posFilt",
- 2: "mskPosFilt",
- 4: "timeFilt",
- 8: "dateFilt",
- 0x10: "gpsOnlyFilter",
- 0x20: "trackFilt",
- }
- cfg_nmea_ver = {
- 0x11: "2.1",
- 0x23: "2,3",
- 0x40: "4.0",
- 0x41: "4.10",
- }
- cfg_nmea_flags = {
- 1: "compat",
- 2: "consider",
- 4: "limit82",
- 8: "highPrec",
- }
- cfg_nmea_svn = {
- 0: "Strict",
- 1: "Extended",
- }
- cfg_nmea_mtid = {
- 0: "Default",
- 1: "GP",
- 2: "GL",
- 3: "GN",
- 4: "GA",
- 5: "GB",
- }
- cfg_nmea_gtid = {
- 0: "GNSS Specific",
- 1: "Main",
- }
- cfg_nmea_gnssfilt = {
- 1: "gps",
- 2: "sbas",
- 0x10: "qzss",
- 0x20: "glonass",
- 0x40: "beidou",
- }
- def cfg_nmea(self, buf):
- """UBX-CFG-NMEA decode, Extended NMEA protocol configuration V1"""
- u = struct.unpack_from('<BBBBLBBBBBBBBBBBB', buf, 0)
- s = (" filter x%x nmeaVersion x%x numSv %u flags x%x "
- "gnssToFilter x%x\n"
- " svNumbering %u mainTalkerId %u gsvTalkerId %u version %u\n"
- " bdsTalkerId %u %u reserved1 %u %u %u %u %u %u" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n filter (%s) NMEA Version (%s) numSv (%s) flags (%s)"
- "\n gnssToFilter (%s) svNumbering (%s) mainTalkerId (%s)"
- "\n gsvTalkerId (%s)" %
- (flag_s(u[0], self.cfg_nmea_filter),
- index_s(u[1], self.cfg_nmea_ver),
- u[2] if 0 != u[2] else "Unlimited",
- flag_s(u[3], self.cfg_nmea_flags),
- flag_s(u[4], self.cfg_nmea_gnssfilt),
- index_s(u[5], self.cfg_nmea_svn),
- index_s(u[6], self.cfg_nmea_mtid),
- index_s(u[7], self.cfg_nmea_gtid)))
- return s
- cfg_nvs_mask = {
- 0x20000: 'alm',
- 0x20000000: 'aop',
- }
- def cfg_nvs(self, buf):
- """UBX-CFG-NVS decode, Clear,
- Save and Load non-volatile storage data"""
-
- u = struct.unpack_from('<LLLB', buf, 0)
- s = (' clearMask: %#x (%s)\n' %
- (u[0], flag_s(u[0], self.cfg_nvs_mask)))
- s += (' saveMask: %#x (%s)\n' %
- (u[1], flag_s(u[1], self.cfg_nvs_mask)))
- s += (' loadMask: %#x (%s)\n' %
- (u[2], flag_s(u[2], self.cfg_nvs_mask)))
- s += (' deviceMask: %#x (%s)\n' %
- (u[3], flag_s(u[3], self.cfg_cfg_dev)))
- return s
- cfg_odo_flags = {
- 1: "useODO",
- 2: "useCOG",
- 4: "useLPVel",
- 8: "useLPCog",
- }
- cfg_odo_profile = {
- 0: "Running",
- 1: "Cycling",
- 2: "Swimming",
- 3: "Car",
- 4: "Custom",
- }
- def cfg_odo(self, buf):
- """UBX-CFG-ODO decode, Odometer, Low-speed COG Engine Settings"""
- u = struct.unpack_from('<BBBBBBBBBBBBBBBBBBBB', buf, 0)
- s = (" version %u reserved1 %u %u %u flags x%x odoCfg x%x\n"
- " reserved2 %u %u %u %u %u %u\n"
- " cagMaxSpeed %u cogMaxPosAcc %u reserved3 %u %u\n"
- " velLpGain %u cogLpGain %u reserved4 %u %u" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n flags (%s) odoCfg (%s)" %
- (flag_s(u[4], self.cfg_odo_flags),
- index_s(u[5], self.cfg_odo_profile)))
- return s
- cfg_pm_flags = {
- 0x20: "extintWake",
- 0x40: "extintBackup",
- 0x80: "extintInactive",
- 0x400: "waitTimeFix",
- 0x800: "updateRTC",
- 0x1000: "updateEPH",
- 0x10000: "doNotEnterOff",
- }
- cfg_pm_limitPeakCurr = {
- 0: "disabled",
- 1: "enabled",
- 2: "reserved",
- 3: "reserved3",
- }
- def cfg_pm(self, buf):
- """UBX-CFG-PM decode, Poswer Management Configuration"""
-
- u = struct.unpack_from('<BBBBLLLLHH', buf, 0)
- s = (" version %u res1 %u res2 %u res3 %u flags x%x updatePeriod %u\n"
- " searchPeriod %u gridOffset %u onTime %u minAcqTime %u\n" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n flags (%s) extintSel (EXTINT%u) '
- 'limitPeakCurr (%s)' %
- (flag_s(u[4], self.cfg_pm_flags),
- (u[4] >> 4) & 1,
- index_s((u[4] >> 8) & 3, self.cfg_pm_limitPeakCurr)))
- return s
- cfg_pm2_mode = {
- 0: "ON/OFF operation (PSMOO)",
- 1: "Cyclic tracking operation (PSMCT)",
- 2: "reserved",
- 3: "reserves3",
- }
- cfg_pm2_optTarget = {
- 0: "performance",
- 1: "power save",
- }
- def cfg_pm2(self, buf):
- """UBX-CFG-PM2 decode, Extended Power Mode Configuration"""
-
-
-
-
- m_len = len(buf)
-
- u = struct.unpack_from('<BBBBLLLLHHLLLLL', buf, 0)
- s = (" version %u reserved1 %u maxStartupStateDur %u reserved2 %u\n"
- " flags x%x updatePeriod %u searchPeriod %u\n"
- " gridOffset %u ontime %u minAcqTime %u\n"
- " reserved3 %u %u %u %u %u" % u)
- if 48 <= m_len:
- u1 = struct.unpack_from('<L', buf, 44)
- s += "\n extintInactivityMs %u" % u1
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n flags (%s) extintSel (EXTINT%u)'
- '\n limitPeakCurr (%s)'
- '\n optTarget (%s) mode (%s)' %
- (flag_s(u[4], self.cfg_pm_flags),
- (u[4] >> 4) & 1,
- index_s((u[4] >> 8) & 3, self.cfg_pm_limitPeakCurr),
- index_s((u[4] >> 1) & 3, self.cfg_pm2_optTarget,
- nf="reserved"),
- index_s((u[4] >> 17) & 3, self.cfg_pm2_mode)))
- return s
- cfg_pms_values = {0: "Full power",
- 1: "Balanced",
- 2: "Interval",
- 3: "Aggressive with 1Hz",
- 4: "Aggressive with 2Hz",
- 5: "Aggressive with 4Hz",
- 0xff: "Invalid"
- }
- def cfg_pms(self, buf):
- """UBX-CFG-PMS decode, Power Mode Setup"""
- u = struct.unpack_from('<BBHHBB', buf, 0)
- s = (' version %u powerSetupValue %u'
- ' period %u onTime %#x reserved1 %u %u' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n powerSetupValue (%s)' %
- index_s(u[1], self.cfg_pms_values))
- return s
- cfg_prt_flags = {
- 0x2: 'extendedTxTimeout',
- }
- cfg_prt_proto = {
- 0x1: 'UBX',
- 0x2: 'NMEA',
- 0x4: 'RTCM2',
- 0x20: 'RTCM3',
- }
- def cfg_prt(self, buf):
- """UBX-CFG-PRT decode, Port Configuration """
- m_len = len(buf)
- portid = buf[0]
- idstr = '%u (%s)' % (portid, self.port_ids.get(portid, '?'))
- if 1 == m_len:
- return " Poll request PortID %s" % idstr
-
-
- if 20 > m_len:
- return " Bad Length %s" % m_len
- u = struct.unpack_from('<BBHLLHHHH', buf, 0)
- s = [' PortID %s reserved1 %u txReady %#x' % (idstr, u[1], u[2])]
- s.append({1: ' mode %#x baudRate %u',
- 2: ' mode %#x baudRate %u',
- 3: ' reserved2 [%u %u]',
- 4: ' mode %#x reserved2 %u',
- 0: ' mode %#x reserved2 %u',
- }.get(portid, ' ???: %u,%u') % tuple(u[3:5]))
- s.append(' inProtoMask %#x outProtoMask %#x' % tuple(u[5:7]))
- s.append({1: ' flags %#x reserved2 %u',
- 2: ' flags %#x reserved2 %u',
- 3: ' reserved3 %u reserved4 %u',
- 4: ' flags %#x reserved3 %u',
- 0: ' flags %#x reserved3 %u',
- }.get(portid, ' ??? %u,%u') % tuple(u[7:]))
- if portid == 0:
- s.append(' slaveAddr %#x' % (u[3] >> 1 & 0x7F))
- s.append(' inProtoMask (%s)\n'
- ' outProtoMask (%s)' %
- (flag_s(u[5], self.cfg_prt_proto),
- flag_s(u[6], self.cfg_prt_proto)))
- if portid in set([1, 2, 4, 0]):
- s.append(' flags (%s)' % flag_s(u[7], self.cfg_prt_flags))
- return '\n'.join(s)
- cfg_pwr_state = {
- 0x52554E20: "GNSS running",
- 0x53544F50: "GNSS stopped",
- 0x42434B50: "Software Backup",
- }
- def cfg_pwr(self, buf):
- """UBX-CFG-PWR decode, Put receiver in a defined power state"""
- u = struct.unpack_from('<BBBBL', buf, 0)
- s = (" version %u reserved %u %u %u state %u" %
- (u + (index_s(u[0], self.cfg_pwr_state),)))
- return s
- cfg_rate_system = {
- 0: "UTC",
- 1: "GPS",
- 2: "GLONASS",
- 3: "BeiDou",
- 4: "Galileo",
- }
- def cfg_rate(self, buf):
- """UBX-CFG-RATE decode, Navigation/Measurement Rate Settings"""
- u = struct.unpack_from('<HHH', buf, 0)
- s = (" measRate %u navRate %u timeRef %u (%s)" %
- (u + (index_s(u[2], self.cfg_rate_system),)))
- return s
- cfg_rinv_flags = {
- 1: "dump",
- 2: "binary",
- }
- def cfg_rinv(self, buf):
- """UBX-CFG-RINV decode, Contents of Remote Inventory"""
-
- m_len = len(buf)
- u = struct.unpack_from('<B', buf, 0)
- s = (" flags x%x (%s) data:" %
- (u + (flag_s(u[0], self.cfg_rinv_flags),)))
- for i in range(0, m_len - 1):
- if 0 == (i % 8):
- s += "\n "
- u = struct.unpack_from('<B', buf, i + 1)
- s += " %3u" % u
- return s
- cfg_rst_navBbr = {
- 0: "Hot Start",
- 1: "Warm Start",
- 0xffff: "Cold Start",
- }
- cfg_rst_navBbr1 = {
- 1: "eph",
- 2: "alm",
- 4: "health",
- 8: "klob",
- 0x10: "pos",
- 0x20: "clkd",
- 0x40: "osc",
- 0x80: "utc",
- 0x100: "rtc",
- 0x8000: "aop",
- }
- cfg_rst_resetMode = {
- 0: "Hardware reset",
- 1: "Software reset",
- 2: "Software reset (GNSS only)",
- 4: "Hardware reset, after shutdown",
- 8: "Controlled GNSS stop",
- 9: "Controlled GNSS start",
- }
- def cfg_rst(self, buf):
- """"UBX-CFG-RST decode, Reset Receiver/Clear Backup Data Structures"""
- u = struct.unpack_from('<HBB', buf, 0)
- s = ' navBbrmask x%x resetMode %u reserved %u' % u
- if VERB_DECODE <= opts['verbosity']:
-
- s1 = index_s(u[0], self.cfg_rst_navBbr, nf="")
- if not s1:
- s1 = flag_s(u[0], self.cfg_rst_navBbr1)
- s += ("\n resetMode (%s)"
- "\n navBbrMask (%s)" %
- (index_s(u[1], self.cfg_rst_resetMode),
- s1))
- return s
- cfg_rxm_lpMode = {
- 0: "Continuous Mode",
- 1: "Power Save Mode",
- 4: "Continuous Mode",
- }
- def cfg_rxm(self, buf):
- """UBX-CFG-RXM decode, Navigation/Measurement"""
- u = struct.unpack_from('<BB', buf, 0)
- s = (" reserved1 %u lpMode %u (%s)" %
- (u + (index_s(u[1], self.cfg_rxm_lpMode),)))
- return s
- cfg_sbas_mode = {
- 1: "enabled",
- 2: "test",
- }
- cfg_sbas_usage = {
- 1: "range",
- 2: "diffCorr",
- 3: "integrity",
- }
- cfg_sbas_scanmode1 = {
- 1: "PRN120",
- 2: "PRN121",
- 4: "PRN122",
- 8: "PRN123",
- 0x10: "PRN124",
- 0x20: "PRN125",
- 0x40: "PRN126",
- 0x80: "PRN127",
- 0x100: "PRN128",
- 0x200: "PRN129",
- 0x400: "PRN130",
- 0x800: "PRN131",
- 0x1000: "PRN132",
- 0x2000: "PRN133",
- 0x4000: "PRN134",
- 0x8000: "PRN135",
- 0x10000: "PRN136",
- 0x20000: "PRN137",
- 0x40000: "PRN138",
- 0x80000: "PRN139",
- 0x100000: "PRN140",
- 0x200000: "PRN141",
- 0x400000: "PRN142",
- 0x800000: "PRN143",
- 0x1000000: "PRN144",
- 0x2000000: "PRN145",
- 0x4000000: "PRN146",
- 0x8000000: "PRN147",
- 0x10000000: "PRN148",
- 0x20000000: "PRN149",
- 0x40000000: "PRN150",
- 0x80000000: "PRN151",
- }
- cfg_sbas_scanmode2 = {
- 1: "PRN152",
- 2: "PRN153",
- 4: "PRN154",
- 8: "PRN155",
- 0x10: "PRN156",
- 0x20: "PRN157",
- 0x40: "PRN158",
- }
- def cfg_sbas(self, buf):
- """UBX-CFG-SBAS decode, SBAS Configuration"""
- u = struct.unpack_from('<BBBBL', buf, 0)
- s = (" mode x%x usage x%x maxSBAS %u scanMode2 x%x"
- " scanMode1: x%x" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n mode (%s) usage (%s) scanmode2 (%s)"
- "\n scanmode1 (%s)" %
- (flag_s(u[0], self.cfg_sbas_mode),
- flag_s(u[1], self.cfg_sbas_usage),
- flag_s(u[3], self.cfg_sbas_scanmode2),
- flag_s(u[4], self.cfg_sbas_scanmode1)))
- return s
- cfg_slas_mode = {
- 1: "enabled",
- 2: "test",
- 4: "raim",
- }
- def cfg_slas(self, buf):
- """UBX-CFG-SLAS decode, SLAS configuration"""
-
- u = struct.unpack_from('<BBH', buf, 0)
- s = " mode %u reserved1 %u %u" % u
- if VERB_DECODE <= opts['verbosity']:
- s += "\n mode (%s)" % (flag_s(u[0], self.cfg_slas_mode))
- return s
- cfg_smgr_messageCfg = {
- 1: "measInternal",
- 2: "measGNSS",
- 4: "measEXTINT0",
- 8: "measEXTINT1",
- }
- def cfg_smgr(self, buf):
- """UBX-CFG-SMGR decode, Synchronization manager configuration"""
- u = struct.unpack_from('<BBHHBBHHHHL', buf, 0)
- s = (" version %u minGNSSFix %u maxFreqChangeRate %u "
- "maxPhaseCorrR %u\n"
- " reserved1 %u %u freqTolerance %u timeTolerance %u "
- "messageCfg x%x\n"
- " maxSlewRate %u flags x%x" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n messageCfg (%s)" %
- (flag_s(u[7], self.cfg_smgr_messageCfg)))
- return s
- cfg_tmode_timeMode = {
- 0: "Disabled",
- 1: "Survey In",
- 2: "Fixed Mode",
- }
- def cfg_tmode(self, buf):
- """UBX-CFG-TMODE decode, Time Mode Settings"""
-
- u = struct.unpack_from('<BBHlllLLL', buf, 0)
- s = (' timeMode %u fixedPosX %d fixedPosY %d fixedPosZ %d\n'
- ' fixedPosVar %u svinMinDur %u svinAccLimit %u' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n timeMode (%s)" %
- (index_s(u[0], self.cfg_tmode_timeMode)))
- return s
- cfg_tmode2_flags = {
- 1: "lla",
- 2: "altInv",
- }
- def cfg_tmode2(self, buf):
- """UBX-CFG-TMODE2 decode, Time Mode Settings 2"""
-
-
-
- u = struct.unpack_from('<BBHlllLLL', buf, 0)
- s = (' timeMode %u reserved1 %u usage %#x\n'
- ' ecefXOrLat %d ecefYOrLon %d ecefZOrAlt %d\n'
- ' fixedPosAcc %u svinMinDur %u svinAccLimit %u' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n timeMode (%s) flags (%s)" %
- (index_s(u[0], self.cfg_tmode_timeMode),
- flag_s(u[2], self.cfg_tmode2_flags)))
- return s
- cfg_tmode3_flags = {
- 0x100: "lla",
- }
- def cfg_tmode3(self, buf):
- """UBX-CFG-TMODE3 decode, Time Mode Settings 3"""
-
-
-
-
-
- u = struct.unpack_from('<BBHlllbbbBLLLLL', buf, 0)
- s = (' version %u reserved1 %u flags x%x\n'
- ' ecefXOrLat %d ecefYOrLon %d ecefZOrAlt %d\n'
- ' ecefXOrLatHP %d ecefYOrLonHP %d ecefZOrAltHP %d\n'
- ' reserved2 %u fixedPosAcc %u svinMinDur %u svinAccLimit %u\n'
- ' reserved3 %u %u' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n flags (%s %s)" %
- (index_s(u[2], self.cfg_tmode_timeMode),
- flag_s(u[2] & 0x100, self.cfg_tmode3_flags)))
- return s
- cfg_tp_status = {
- -1: "negative",
- 0: "off",
- 1: "positive",
- }
- cfg_tp_timeRef = {
- 0: "UTC",
- 1: "GPS",
- 2: "Local",
- }
- cfg_tp_flags = {
- 1: "syncMode",
- }
- def cfg_tp(self, buf):
- """UBX-CFG-TP decode, Time Pulse Settings"""
-
- u = struct.unpack_from('<HHbBBBhhl', buf, 0)
- s = (' interval %u length %u status %d timeRef %u flags x%x res x%x\n'
- ' antennaCableDelay %u rfGroupDelay %d userDelay %d' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n flags (%s, %s, %s)" %
- (index_s(u[2], self.cfg_tp_status),
- index_s(u[3], self.cfg_tp_timeRef),
- flag_s(u[4], self.cfg_tp_flags)))
- return s
- cfg_tp5_flags = {
- 1: "Active",
- 2: "lockGnssFreq",
- 4: "lockedOtherSet",
- 8: "isFreq",
- 0x10: "isLength",
- 0x20: "alignToTow",
- 0x40: "RisingEdge",
- }
- cfg_tp5_grid = {
- 0: 'UTC',
- 1: 'GPS',
- 2: 'Glonass',
- 3: 'BeiDou',
- 4: 'Galileo',
- }
- def cfg_tp5(self, buf):
- """UBX-CFG-TP5 decode, Time Pulse Parameters"""
- m_len = len(buf)
- if 1 == m_len:
- return " Poll request tpIdx %d" % buf[0]
- if 32 > m_len:
- return " Bad Length %s" % m_len
- u = struct.unpack_from('<BBHhhLLLLlL', buf, 0)
- s = (" tpIdx %u version %u reserved1 %u\n"
- " antCableDelay %d rfGroupDelay %d freqPeriod %u "
- "freqPeriodLock %u\n"
- " pulseLenRatio %u pulseLenRatioLock %u userConfigDelay %d\n"
- " flags x%x" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n flags (%s)"
- "\n gridToGps (%s) syncMode %d" %
- (flag_s(u[10] & 0x7f, self.cfg_tp5_flags),
- index_s((u[10] >> 7) & 0x0f, self.cfg_tp5_grid),
- (u[10] >> 11) & 0x03))
- return s
- cfg_usb_flags = {1: "reEnum "}
- cfg_usb_powerMode = {0: "self-powered",
- 2: "bus-powered",
- }
- def cfg_usb(self, buf):
- """UBX-CFG-USB decode, USB Configuration"""
- u = struct.unpack_from('<HHHHHH', buf, 0)
- s = (' vendorID %#x productID %#x reserved1 %u reserved2 %u\n'
- ' powerConsumption %u mA flags %#x' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n flags (%s%s)" %
- (flag_s(u[5] & 1, self.cfg_usb_flags),
- index_s(u[5] & 2, self.cfg_usb_powerMode)))
- s += ('\n vendorString %s\n'
- ' productString %s\n'
- ' serialNumber %s' %
- (gps.polystr(buf[12:43]).rstrip('\0'),
- gps.polystr(buf[44:75]).rstrip('\0'),
- gps.polystr(buf[76:107]).rstrip('\0')))
- return s
- cfg_valdel_layers = {
- 1: 'ram',
- 2: 'bbr',
- 4: 'flash',
- }
- cfg_valget_layers = {
- 0: 'ram',
- 1: 'bbr',
- 2: 'flash',
- 7: 'default',
- }
- cfg_valxxx_trans = {
- 0: "Transactionless",
- 1: "(Re)start Transaction",
- 2: "Continue Transaction",
- 3: "Apply and end Transaction",
- }
- def cfg_valdel(self, buf):
- """"UBX-CFG-VALDEL decode, Delete configuration items"""
- m_len = len(buf)
-
- u = struct.unpack_from('<BBBB', buf, 0)
- s = ' version %u layer %#x transaction %#x reserved %u\n' % u
- s += (' layers (%s) transaction (%s)' %
- (flag_s(u[1], self.cfg_valdel_layers),
- index_s(u[2], self.cfg_valxxx_trans)))
- m_len -= 4
- i = 0
- while 0 < m_len:
- u = struct.unpack_from('<L', buf, 4 + i * 4)
- item = self.cfg_by_key(u[0])
- s += ('\n item: %s/%#x' % (item[0], u[0]))
- m_len -= 4
- i += 1
- return s
- def cfg_valget(self, buf):
- """"UBX-CFG-VALGET decode, Get configuration items"""
- m_len = len(buf)
-
-
- u = struct.unpack_from('<BBH', buf, 0)
- s = ' version %u layer %u position %u\n' % u
- s += ' layers (%s)' % index_s(u[1], self.cfg_valget_layers)
- m_len -= 4
- i = 0
- if 0 == u[0]:
-
- while 0 < m_len:
- u = struct.unpack_from('<L', buf, 4 + i * 4)
- item = self.cfg_by_key(u[0])
- s += ('\n item %s/%#x' % (item[0], u[0]))
- m_len -= 4
- i += 1
- else:
-
-
- if 27 > opts['protver']:
- opts['protver'] = 27
-
- i += 4
- while 4 < m_len:
- u = struct.unpack_from('<L', buf, i)
- m_len -= 4
- i += 4
- item = self.cfg_by_key(u[0])
- cfg_type = self.item_to_type(item)
- size = cfg_type[0]
- if size > m_len:
- s += "\nWARNING: not enough bytes!"
- break
- frmat = cfg_type[1]
-
- v = struct.unpack_from(frmat, buf, i)
- s += ('\n item %s/%#x val %s' % (item[0], u[0], v[0]))
- m_len -= size
- i += size
- if 0 < m_len:
- s += "\nWARNING: %d extra bytes!" % m_len
- return s
- def cfg_valset(self, buf):
- """"UBX-CFG-VALSET decode, Set configuration items"""
- m_len = len(buf)
-
- u = struct.unpack_from('<BBBB', buf, 0)
- s = ' version %u layer %#x transaction %#x reserved %u\n' % u
- s += (' layers (%s) transaction (%s)' %
- (flag_s(u[1], self.cfg_valdel_layers),
- index_s(u[2], self.cfg_valxxx_trans)))
-
- m_len -= 4
- i = 4
- while 4 < m_len:
- u = struct.unpack_from('<L', buf, i)
- m_len -= 4
- i += 4
- item = self.cfg_by_key(u[0])
- cfg_type = self.item_to_type(item)
- size = cfg_type[0]
-
- frmat = cfg_type[1]
-
- v = struct.unpack_from(frmat, buf, i)
- s += ('\n item %s/%#x val %s' % (item[0], u[0], v[0]))
- m_len -= size
- i += size
- if 0 < m_len:
- s += "\nWARNING: %d extra bytes!" % m_len
- return s
- cfg_ids = {
-
- 0x00: {'str': 'PRT', 'dec': cfg_prt, 'minlen': 1,
- 'name': 'UBX-CFG-PRT'},
-
- 0x01: {'str': 'MSG', 'dec': cfg_msg, 'minlen': 2,
- 'name': 'UBX-CFG-MSG'},
-
- 0x02: {'str': 'INF', 'dec': cfg_inf, 'minlen': 1,
- 'name': 'UBX-CFG-INF'},
-
- 0x04: {'str': 'RST', 'dec': cfg_rst, 'minlen': 4,
- 'name': 'UBX-CFG-RST'},
-
- 0x06: {'str': 'DAT', 'dec': cfg_dat, 'minlen': 2,
- 'name': 'UBX-CFG-DAT'},
-
- 0x07: {'str': 'TP', 'dec': cfg_tp, 'minlen': 28,
- 'name': 'UBX-CFG-TP'},
-
- 0x08: {'str': 'RATE', 'dec': cfg_rate, 'minlen': 6,
- 'name': 'UBX-CFG-RATE'},
-
- 0x09: {'str': 'CFG', 'dec': cfg_cfg, 'minlen': 12,
- 'name': 'UBX-CFG-CFG'},
-
- 0x0e: {'str': 'FXM', 'dec': cfg_fxn, 'minlen': 36,
- 'name': 'UBX-CFG-FXM'},
-
- 0x11: {'str': 'RXM', 'dec': cfg_rxm, 'minlen': 2,
- 'name': 'UBX-CFG-RXM'},
-
- 0x12: {'str': 'EKF', 'minlen': 16, 'name': 'UBX-CFG-EKF'},
-
- 0x13: {'str': 'ANT', 'dec': cfg_ant, 'minlen': 4,
- 'name': 'UBX-CFG-ANT'},
-
- 0x16: {'str': 'SBAS', 'dec': cfg_sbas, 'minlen': 8,
- 'name': 'UBX-CFG-SBAS'},
-
- 0x17: {'str': 'NMEA', 'dec': cfg_nmea, 'minlen': 20,
- 'name': 'UBX-CFG-NMEA'},
-
- 0x1b: {'str': 'USB', 'dec': cfg_usb, 'minlen': 108,
- 'name': 'UBX-CFG-USB'},
-
- 0x1d: {'str': 'TMODE', 'dec': cfg_tmode, 'minlen': 28,
- 'name': 'UBX-CFG-TMODE'},
-
- 0x1e: {'str': 'ODO', 'dec': cfg_odo, 'minlen': 20,
- 'name': 'UBX-CFG-ODO'},
-
- 0x22: {'str': 'NVS', 'dec': cfg_nvs, 'minlen': 13,
- 'name': 'UBX-CFG-NVS'},
-
- 0x23: {'str': 'NAVX5', 'dec': cfg_navx5, 'minlen': 20,
- 'name': 'UBX-CFG-NAVX5'},
-
- 0x24: {'str': 'NAV5', 'dec': cfg_nav5, 'minlen': 36,
- 'name': 'UBX-CFG-NAV5'},
-
- 0x29: {'str': 'ESFGWT', 'minlen': 44, 'name': 'UBX-CFG-ESFGWT'},
-
- 0x31: {'str': 'TP5', 'dec': cfg_tp5, 'minlen': 1,
- 'name': 'UBX-CFG-TP5'},
-
- 0x32: {'str': 'PM', 'dec': cfg_pm, 'minlen': 24,
- 'name': 'UBX-CFG-PM'},
-
- 0x34: {'str': 'RINV', 'dec': cfg_rinv, 'minlen': 1,
- 'name': 'UBX-CFG-RINV'},
-
- 0x39: {'str': 'ITFM', 'dec': cfg_itfm, 'minlen': 8,
- 'name': 'UBX-CFG-ITFM'},
-
- 0x3b: {'str': 'PM2', 'dec': cfg_pm2, 'minlen': 44,
- 'name': 'UBX-CFG-PM2'},
-
- 0x3d: {'str': 'TMODE2', 'dec': cfg_tmode2, 'minlen': 28,
- 'name': 'UBX-CFG-TMODE2'},
-
- 0x3e: {'str': 'GNSS', 'dec': cfg_gnss, 'minlen': 4,
- 'name': 'UBX-CFG-GNSS'},
-
- 0x47: {'str': 'LOGFILTER', 'dec': cfg_logfilter, 'minlen': 12,
- 'name': 'UBX-CFG-LOGFILTER'},
-
- 0x53: {'str': 'TXSLOT', 'minlen': 2, 'name': 'UBX-CFG-TXSLOT'},
-
- 0x57: {'str': 'PWR', 'dec': cfg_pwr, 'minlen': 8,
- 'name': 'UBX-CFG-PWR'},
-
- 0x5c: {'str': 'HNR', 'dec': cfg_hnr, 'minlen': 4,
- 'name': 'UBX-CFG-HNR'},
-
- 0x60: {'str': 'ESRC', 'dec': cfg_esrc, 'minlen': 4,
- 'name': 'UBX-CFG-ESRC'},
-
- 0x61: {'str': 'DOSC', 'dec': cfg_dosc, 'minlen': 4,
- 'name': 'UBX-CFG-DOSC'},
-
- 0x62: {'str': 'SMGR', 'dec': cfg_smgr, 'minlen': 20,
- 'name': 'UBX-CFG-SMGR'},
-
- 0x69: {'str': 'GEOFENCE', 'dec': cfg_geofence, 'minlen': 8,
- 'name': 'UBX-CFG-GEOFENCE'},
-
- 0x70: {'str': 'DGNSS', 'dec': cfg_dgnss, 'minlen': 4,
- 'name': 'UBX-CFG-DGNSS'},
-
-
- 0x71: {'str': 'TMODE3', 'dec': cfg_tmode3, 'minlen': 40,
- 'name': 'UBX-CFG-TMODE3'},
-
- 0x84: {'str': 'FIXSEED', 'dec': cfg_fixseed, 'minlen': 12,
- 'name': 'UBX-CFG-FIXSEED'},
-
- 0x85: {'str': 'DYNSEED', 'dec': cfg_dynseed, 'minlen': 12,
- 'name': 'UBX-CFG-DYNSEED'},
-
- 0x86: {'str': 'PMS', 'dec': cfg_pms, 'minlen': 8,
- 'name': 'UBX-CFG-PMS'},
-
- 0x8a: {'str': 'VALSET', 'dec': cfg_valset, 'minlen': 4,
- 'name': 'UBX-CFG-VALSET'},
-
- 0x8b: {'str': 'VALGET', 'dec': cfg_valget, 'minlen': 4,
- 'name': 'UBX-CFG-VALGET'},
-
- 0x8c: {'str': 'VALDEL', 'dec': cfg_valdel, 'minlen': 4,
- 'name': 'UBX-CFG-VALDEL'},
-
- 0x8d: {'str': 'SLAS', 'dec': cfg_slas, 'minlen': 4,
- 'name': 'UBX-CFG-SLAS'},
-
- 0x93: {'str': 'BATCH', 'dec': cfg_batch, 'minlen': 8,
- 'name': 'UBX-CFG-BATCH'},
- }
-
-
- esf_ids = {0x02: {'str': 'MEAS', 'minlen': 8, 'name': "UBX-ESF-MEAS"},
- 0x03: {'str': 'RAW', 'minlen': 4, 'name': "UBX-ESF-RAW"},
- 0x10: {'str': 'STATUS', 'minlen': 16, 'name': "UBX-ESF-STATUS"},
- 0x15: {'str': 'INS', 'minlen': 16, 'name': "UBX-ESF-INS"},
- }
-
-
- hnr_ids = {0x00: {'str': 'PVT', 'minlen': 72, 'name': "UBX-HNR-PVT"},
- 0x02: {'str': 'INS', 'minlen': 36, 'name': "UBX-HNR-INS"},
- }
- def inf_debug(self, buf):
- """UBX-INF-DEBUG decode"""
- return ' Debug: ' + gps.polystr(buf)
- def inf_error(self, buf):
- """UBX-INF-ERROR decode"""
- return ' Error: ' + gps.polystr(buf)
- def inf_notice(self, buf):
- """UBX-INF-NOTICE decode"""
- return ' Notice: ' + gps.polystr(buf)
- def inf_test(self, buf):
- """UBX-INF-TET decode"""
- return ' Test: ' + gps.polystr(buf)
- def inf_warning(self, buf):
- """UBX-INF-WARNING decode"""
- return ' Warning: ' + gps.polystr(buf)
- inf_ids = {0x0: {'str': 'ERROR', 'dec': inf_error, 'minlen': 0,
- 'name': 'UBX-INF-ERROR'},
- 0x1: {'str': 'WARNING', 'dec': inf_warning, 'minlen': 0,
- 'name': 'UBX-INF-WARNING'},
- 0x2: {'str': 'NOTICE', 'dec': inf_notice, 'minlen': 0,
- 'name': 'UBX-INF-NOTICE'},
- 0x3: {'str': 'TEST', 'dec': inf_test, 'minlen': 0,
- 'name': 'UBX-INF-TEST'},
- 0x4: {'str': 'DEBUG', 'dec': inf_debug, 'minlen': 0,
- 'name': 'UBX-INF-DEBUG'},
- }
- log_batch_contentValid = {
- 1: 'extraPvt',
- 2: 'extraOdo',
- }
- log_batch_valid = {
- 1: 'validDate',
- 2: 'validTime',
- }
- log_batch_fixType = {
- 0: 'No Fix',
- 2: '2D Fix',
- 3: '3D Fix',
- 4: 'GNSS + DR',
- }
- log_batch_flags = {
- 1: 'gnssFixOK',
- 2: 'diffSoln',
- }
- log_batch_psmState = {
- 0: 'Not Active',
- 4: 'Enabled',
- 8: 'Acquisition',
- 9: 'Tracking',
- 0x10: 'Power Optimized Tracking',
- 0x11: 'Inactive',
- }
- def log_batch(self, buf):
- """UBX-LOG-BATCH decode
- Oddly this is polled with UBX-LOG-RETRIEVEBATCH
- """
-
-
- u = struct.unpack_from('<BBHLHBBBBBBLlBBBBllllLLlllllLLHHLLLL', buf, 0)
- s = (" version %u contentValid x%x msgCnt %u iTow %u\n"
- " year %u month %u day %u hour %u min %u sec %u valid x%x\n"
- " tAcc %u fracSec %d fixType %u flags x%x flags2 x%x numSV %u\n"
- " lon %d lat %d height %d hMSL %d\n"
- " hAcc %u vAcc %u\n"
- " vel N %u E %u D %u gSpeed %d headMot %d sAcc %u headAcc %u\n"
- " pdep %u reserved1 x%x distance %u totalDistance %u\n"
- " distanceStd %u reserved2 x%x" % u)
- if VERB_DECODE <= opts['verbosity']:
-
- s += ("\n contentValid (%s) valid (%s)"
- "\n fixType (%s)"
- "\n flags (%s) psmState (%s)" %
- (flag_s(u[1], self.log_batch_contentValid),
- flag_s(u[10], self.log_batch_valid),
- index_s(u[13], self.log_batch_fixType),
- flag_s(u[14] & 3, self.log_batch_flags),
- index_s(u[14] & 0x1c, self.log_batch_psmState)))
- return s
- log_create_logCfg = {
- 1: 'circular',
- }
- log_create_logSize = {
- 0: 'Maximum safe',
- 1: 'Minimum safe',
- 2: 'user defined',
- }
- def log_create(self, buf):
- """UBX-LOG-CREATE decode"""
-
- u = struct.unpack_from('<BBBBL', buf, 0)
- s = (" version %u logCfg x%x reserved1 x%x logSize %u\n"
- " userDefinedSize %u" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n logCfg (%s) logSize (%s)" %
- (flag_s(u[1], self.log_create_logCfg),
- index_s(u[3], self.log_create_logSize)))
- return s
- def log_erase(self, buf):
- """UBX-LOG-ERASE decode"""
-
- return " Erase Logged Data"
- log_findtime_type = {
- 0: 'request',
- 1: 'response',
- }
- def log_findtime(self, buf):
- """UBX-LOG-FINDTIME decode"""
-
- m_len = len(buf)
-
-
-
- if 8 == m_len:
-
- u = struct.unpack_from('<BBHL', buf, 0)
- s = " version %u type %u reserved1 x%x entryNumber %u" % u
- if 1 != u[0] or 1 != u[1]:
- s += "\nWARNING: Unknown version, type (%u, %u)" % (u[0], u[1])
- elif 10 == m_len:
-
- u = struct.unpack_from('<BBHBBBBBB', buf, 0)
- s = (" version %u type %u\n"
- " year %u month %u day %u hour %u min %u sec %u "
- "reserved2 x%x" % u)
- if 0 != u[0] or 0 != u[1]:
- s += "\nWARNING: Unknown version, type (%u, %u)" % (u[0], u[1])
- elif 12 == m_len:
-
- u = struct.unpack_from('<BBHHBBBBBB', buf, 0)
- s = (" version %u type %u reserved1 x%x\n"
- " year %u month %u day %u hour %u min %u sec %u "
- "reserved2 x%x" % u)
- if 0 != u[0] or 0 != u[1]:
- s += "\nWARNING: Unknown version, type (%u, %u)" % (u[0], u[1])
- else:
- return " Bad Length %s" % m_len
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n type (%s)" %
- (index_s(u[1], self.log_findtime_type)))
- return s
- log_info_status = {
- 8: 'recording',
- 0x10: 'inactive',
- 0x20: 'circular',
- }
- def log_info(self, buf):
- """UBX-LOG-INFO decode"""
-
- u = struct.unpack_from('<BBHLLLLLLHBBBBBBHBBBBBBBBH', buf, 0)
- s = (" version %u reserved1 x%x x%x filestoreCapacity %u "
- "reserved2 x%x x%x\n"
- " currentMaxLogSize %u currentLogSize %u entryCount %u\n"
- " oldestYear %u oldestMonth %u oldestDay %u \n"
- " oldestHour %u oldestMin %u oldestSec %u reserved3 x%x\n"
- " newestYear %u newestMonth %u newestDay %u \n"
- " newestHour %u newestMin %u newestSec %u reserved4 x%x\n"
- " status x%x reserved5 x%x x%x" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n status (%s)" %
- (flag_s(u[23], self.log_info_status)))
- return s
- log_retrievebatch_flags = {
- 1: 'sendMonFirst',
- }
- def log_retrieve(self, buf):
- """UBX-LOG-RETRIEVE decode"""
-
- u = struct.unpack_from('<LLBBH', buf, 0)
- s = " startNumber %u entryCount %u version %u reserved1 x%x %x" % u
- return s
- def log_retrievebatch(self, buf):
- """UBX-LOG-RETRIEVEBATCH decode
- Oddly this is the poll for UBX-LOG-BATCH
- """
-
-
- u = struct.unpack_from('<BBH', buf, 0)
- s = (" version %u flags x%x reserved1 x%x" % u)
- if VERB_DECODE <= opts['verbosity']:
-
- s += ("\n flags (%s)" %
- flag_s(u[1], self.log_retrievebatch_flags))
- return s
- def log_retrievepos(self, buf):
- """UBX-LOG-RETRIEVEPOS decode"""
-
- u = struct.unpack_from('<LlllLLLBBHBBBBBBBB', buf, 0)
- s = (" entryIndex %u lon %d lat %d hMSL %d hAcc %u\n"
- " gSpeed %u heading %u version %u fixType %u\n"
- " year %u month %u day %u hour %u min %u sec %u\n"
- " reserved1 x%x numSV %u reserved2 x%x" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n fixType (%s)" %
- (index_s(u[8], self.log_batch_fixType)))
- return s
- def log_retrieveposextra(self, buf):
- """UBX-LOG-RETRIEVEPOSEXTRA decode"""
-
- u = struct.unpack_from('<LBBHBBBBBBHLLLL', buf, 0)
- s = (" entryIndex %u version %u reserved1 x%x\n"
- " year %u month %u day %u hour %u minute %u seconds %u\n"
- " reserved2 x%x %x distance %u reserved3 x%x %x %x" % u)
- return s
- def log_retrievestring(self, buf):
- """UBX-LOG-RETRIEVESTRING decode"""
-
- u = struct.unpack_from('<LBBHBBBBBBH', buf, 0)
- s = (" entryIndex %u version %u reserved2 x%x\n"
- " year %u month %u day %u hour %u min %u sec %u\n"
- " reserved2 x%x byteCount %u\n"
- " bytes \"" % u)
- if 0 < u[10]:
- for c in buf[16:16 + u[10]]:
- if c < 127 and chr(c) in string.printable:
- s += chr(c)
- else:
- s += "\\x%02x" % c
- s += '"'
- return s
- def log_string(self, buf):
- """UBX-LOG-STRING decode"""
-
- m_len = len(buf)
- if 256 < m_len:
- return " Bad Length %s" % m_len
- s = " bytes "
- if 0 < m_len:
- s += gps.polystr(binascii.hexlify(buf))
- return s
-
- log_ids = {
- 0x03: {'str': 'ERASE', 'dec': log_erase, 'minlen': 0,
- 'name': "UBX-LOG-ERASE"},
- 0x04: {'str': 'STRING', 'dec': log_string, 'minlen': 0,
- 'name': "UBX-LOG-STRING"},
- 0x07: {'str': 'CREATE', 'dec': log_create, 'minlen': 8,
- 'name': "UBX-LOG-CREATE"},
- 0x08: {'str': 'INFO', 'dec': log_info, 'minlen': 48,
- 'name': "UBX-LOG-INFO"},
- 0x09: {'str': 'RETRIEVE', 'dec': log_retrieve, 'minlen': 12,
- 'name': "UBX-LOG-RETRIEVE"},
- 0x0b: {'str': 'RETRIEVEPOS', 'dec': log_retrievepos,
- 'minlen': 40,
- 'name': "UBX-LOG-RETRIEVEPOS"},
- 0x0d: {'str': 'RETRIEVESTRING', 'dec': log_retrievestring,
- 'minlen': 16,
- 'name': "UBX-LOG-RETRIEVESTRING"},
- 0x0e: {'str': 'FINDTIME', 'dec': log_findtime, 'minlen': 8,
- 'name': "UBX-LOG-FINDTIME"},
- 0x0f: {'str': 'RETRIEVEPOSEXTRA', 'dec': log_retrieveposextra,
- 'minlen': 32,
- 'name': "UBX-LOG-RETRIEVEPOSEXTRA"},
- 0x10: {'str': 'RETRIEVEBATCH', 'dec': log_retrievebatch,
- 'minlen': 2,
- 'name': "UBX-LOG-RETRIEVEBATCH"},
- 0x11: {'str': 'BATCH', 'dec': log_batch, 'minlen': 100,
- 'name': "UBX-LOG-BATCH"},
- }
-
- def mga_dbd(self, buf):
- """UBX-MGA-DBD- decode, Navigation Database Dump Entry"""
-
- u = struct.unpack_from('<LLL', buf, 0)
- s = ' reserved1 %u %u %u' % u
-
- return s
- mga_ids = {0x00: {'str': 'GPS', 'minlen': 16, 'name': "UBX-MGA-GPS"},
- 0x02: {'str': 'GAL', 'minlen': 12, 'name': "UBX-MGA-GAL"},
- 0x03: {'str': 'BDS', 'minlen': 16, 'name': "UBX-MGA-BDS"},
- 0x05: {'str': 'QZSS', 'minlen': 12, 'name': "UBX-MGA-QZSS"},
- 0x06: {'str': 'GLO', 'minlen': 20, 'name': "UBX-MGA-GLO"},
- 0x20: {'str': 'ANO', 'minlen': 76, 'name': "UBX-MGA-ANO"},
- 0x21: {'str': 'FLASH', 'minlen': 2, 'name': "UBX-MGA-FLASH"},
- 0x40: {'str': 'INI', 'minlen': 12, 'name': "UBX-MGA-INI"},
- 0x60: {'str': 'ACK', 'minlen': 8, 'name': "UBX-MGA-ACK"},
- 0x80: {'str': 'DBD', 'dec': mga_dbd, 'minlen': 12,
- 'name': "UBX-MGA-DBD"},
- }
- def mon_batch(self, buf):
- """UBX-MON-BATCH decode, Data batching buffer status"""
-
-
- u = struct.unpack_from('<BBBBHHHH', buf, 0)
- s = (" version %u reserved1 %u %u %u fillLevel %u\n"
- " dropsAll %u dropsSinceMon %u nextMsgCnt %u" % u)
- return s
- mon_comms_prot = {
- 0: "UBX",
- 1: "NMEA",
- 2: "RTCM2",
- 5: "RTCM3",
- 255: "None",
- }
- def mon_comms(self, buf):
- """UBX-MON-COMMS decode, Comm port information"""
-
- if 27 > opts['protver']:
- opts['protver'] = 27
- u = struct.unpack_from('<BBBBBBBB', buf, 0)
- s = ('version %u nPorts %u txErrors x%x reserved1 %u\n'
- 'protIds %#x/%x/%x/%x' % u)
- s += (' (%s/%s/%s/%s)\n' %
- (index_s(u[4], self.mon_comms_prot),
- index_s(u[5], self.mon_comms_prot),
- index_s(u[6], self.mon_comms_prot),
- index_s(u[7], self.mon_comms_prot)))
- if VERB_DECODE <= opts['verbosity']:
- errors = {
- 0x40: "mem",
- 0x80: "alloc",
- }
- s += " txErrors (%s)\n" % (flag_s(u[2], errors))
- for i in range(0, u[1]):
- u = struct.unpack_from('<HHLBBHLBBHHHHHLLL', buf, (8 + (i * 40)))
- name = "%#x (%s)" % (u[0], index_s(u[0], self.port_ids1))
- if 0 < i:
- s += "\n"
- s += ' Port: %s\n' % name
- s += (' txPending %u txBytes %u txUsage %u txPeakUsage %u\n'
- ' rxPending %u rxBytes %u rxUsage %u rxPeakUsage %u\n'
- ' overrunErrs %u msgs %u/%u/%u/%u reserved %x %x '
- 'skipped %u'
- % u[1:])
- return s
- mon_gnss_supported_bits = {
- 1: "GPS",
- 2: "Glonass",
- 4: "Beidou",
- 8: "Galileo",
- }
- def mon_gnss(self, buf):
- """UBX-MON-GNSS decode, Information message major GNSS selection"""
- m_len = len(buf)
- if 8 > m_len:
- return " Bad Length %s" % m_len
- u = struct.unpack_from('<BBBBBBBB', buf, 0)
- s = (' version %u supported %#x defaultGnss %#x enabled %#x\n'
- ' simultaneous %u reserved1 %u %u %u' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n supported (%s)'
- '\n defaultGnss (%s)'
- '\n enabled (%s)' %
- (flag_s(u[1], self.mon_gnss_supported_bits),
- flag_s(u[2], self.mon_gnss_supported_bits),
- flag_s(u[3], self.mon_gnss_supported_bits)))
- return s
- mon_hw_flags = {
- 1: "rtcCalib",
- 2: "safeBoot",
- }
- mon_hw_aPower = {
- 0: "Off",
- 1: "On",
- }
- jammingState = {
- 0: "Unk",
- 1: "OK",
- 2: "Warning",
- 3: "Critical",
- }
- def mon_hw(self, buf):
- """UBX-MON-HW decode, Hardware Status"""
- u = struct.unpack_from('<LLLLHHBBBBLBBBBBBBBBBBBBBBBBBBBLLL', buf, 0)
- s = (' pinSel %#x pinBank %#x pinDir %#x pinVal %#x noisePerMS %u\n'
- ' agcCnt %u aStatus %u aPower %u flags %#x reserved1 %u\n'
- ' usedMask %#x\n'
- ' VP %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u\n'
- ' jamInd %u reserved2 %u %u pinIrq %#x pullH %#x pullL %#x' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n aStatus (%s) aPower (%s) flags (%s) "
- "jammingState (%s)" %
- (index_s(u[6], self.mon_rf_antstat),
- index_s(u[7], self.mon_hw_aPower),
- index_s(u[8], self.mon_hw_flags),
- index_s((u[6] >> 2) & 0x03, self.jammingState)))
- return s
- mon_hw2_cfgSource = {
- 102: "flash image",
- 111: "OTP",
- 112: "config pins",
- 114: "ROM",
- }
- def mon_hw2(self, buf):
- """UBX-MON-HW2 decode, Extended Hardware Status"""
- u = struct.unpack_from('<bBbBBBBBLLLLL', buf, 0)
- s = (' ofsI %d magI %u ofsQ %d magQ %u cfgSource %u\n'
- ' reserved0 %u %u %u lowLevCfg %d reserved1 %u %u\n'
- ' postStatus %u reserved2 %u' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n cfgSource (%s)' %
- (index_s(u[4], self.mon_hw2_cfgSource)))
- return s
- mon_hw3_flags = {
- 1: "rtcCalib",
- 2: "safeBoot",
- 4: "xtgalAbsent",
- }
- mon_hw3_pio = {
- 0: "peripheral",
- 1: "PIO",
- }
- mon_hw3_bank = {
- 0: "A",
- 1: "B",
- 2: "C",
- 3: "D",
- 4: "E",
- 5: "F",
- 6: "G",
- 7: "H",
- }
- mon_hw3_dir = {
- 0: "In",
- 1: "Out",
- }
- mon_hw3_value = {
- 0: "Lo",
- 1: "Hi",
- }
- mon_hw3_mask = {
- 0x20: "VPM",
- 0x40: "IRQ",
- 0x100: "PUp",
- 0x200: "PDn",
- }
- def mon_hw3(self, buf):
- """UBX-MON-HW3 decode, HW I/O pin information"""
-
- if 27 > opts['protver']:
- opts['protver'] = 27
- u = struct.unpack_from('<BBB', buf, 0)
- s = ' version %u nPins %u flags x%x' % u
- nPins = u[1]
- substr = buf[3:12]
- substr = substr.split(gps.polybytes('\0'))[0]
- s += ' hwVersion %s\n' % gps.polystr(substr)
- u1 = struct.unpack_from('<BBBBBBBBB', buf, 13)
- s += ' reserved1 %02x %02x %02x %02x %02x %02x %02x %02x %02x' % u1
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n flags (%s)' %
- (index_s(u[2], self.mon_hw3_flags)))
- for i in range(22, 22 + (nPins * 6), 6):
- u = struct.unpack_from('<HHBB', buf, i)
- s += ('\n pinId %4u pinMask %#5x VP %3u reserved2 %u' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n pinMask (%s %s %s %s %s)' %
- (index_s(u[1] & 1, self.mon_hw3_pio),
- index_s((u[1] >> 1) & 7, self.mon_hw3_bank),
- index_s((u[1] >> 4) & 1, self.mon_hw3_dir),
- index_s((u[1] >> 5) & 1, self.mon_hw3_value),
- flag_s(u[1] & 0xffc0, self.mon_hw3_mask)))
- return s
- def mon_io(self, buf):
- """UBX-MON-IO decode, I/O Subsystem Status"""
- m_len = len(buf)
- s = ''
- for i in range(0, int(m_len / 20)):
- if 0 < i:
- s += "\n"
- u = struct.unpack_from('<LLHHHHL', buf, i * 20)
- s += (' Port: %u (%s)\n' % (i, index_s(i, self.port_ids)))
- s += (' rxBytes %u txBytes %u parityErrs %u framingErrs %u\n'
- ' overrunErrs %u breakCond %u reserved %u' % u)
- return s
- def mon_msgpp(self, buf):
- """UBX-MON-MSGPP decode, Message Parse and Process Status"""
- s = ''
- for i in range(1, 7):
- u = struct.unpack_from('<HHHHHHHH', buf, 0)
- s += " msg%u %u %u %u %u %u %u %u %u\n" % ((i,) + u)
- u = struct.unpack_from('<LLLLLL', buf, 0)
- s += " skipped %u %u %u %u %u %u" % u
- return s
- mon_patch_act = {
- 1: "Active"
- }
- mon_patch_loc = {
- 0: "eFuse",
- 2: "ROM",
- 4: "BBR",
- 6: "File System",
- }
- def mon_patch(self, buf):
- """UBX-MON-PATCH decode, Output information about installed patches."""
-
-
- u = struct.unpack_from('<HH', buf, 0)
- s = " version %u nEntries %u" % u
- for i in range(0, u[1]):
- u = struct.unpack_from('<LLLL', buf, 4 + (i * 16))
- s += ("\n patchInfo x%x comparatorNumber %u patchAddress %u "
- "patchData %u" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n patchInfo (%s, %s)' %
- (flag_s(u[0] & 0x01, self.mon_patch_act),
- index_s(u[0] & 0x06, self.mon_patch_loc)))
- return s
- mon_rf_antstat = {
- 0: "Init",
- 1: "Unk",
- 2: "OK",
- 3: "Short",
- 4: "Open",
- }
- mon_rf_antpwr = {
- 0: "Off",
- 1: "On",
- 2: "Unk",
- }
- def mon_rf(self, buf):
- """UBX-MON-RF decode, RF Information"""
-
-
- if 27 > opts['protver']:
- opts['protver'] = 27
- u = struct.unpack_from('<BBBB', buf, 0)
- s = ' version %u nBlocks %u reserved1 %u %u' % u
- for i in range(0, u[1]):
- u = struct.unpack_from('<BBBBLBBBBHHBbBbBBBB', buf, 4 + (24 * i))
- s += ("\n blockId %u flags x%x antStatus %u antPower %u "
- "postStatus %u reserved2 %u %u %u %u"
- "\n noisePerMS %u agcCnt %u jamInd %u ofsI %d magI %u "
- "ofsQ %d magQ %u"
- "\n reserved3 %u %u %u" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n jammingState (%s) antStatus (%s) antPower (%s)' %
- (index_s(u[1] & 0x03, self.jammingState),
- index_s(u[2], self.mon_rf_antstat),
- index_s(u[3], self.mon_rf_antpwr)))
- return s
- def mon_rxbuf(self, buf):
- """UBX-MON-RXBUF decode, Receiver Buffer Status"""
- rxbuf_name = {
- 1: " pending ",
- 2: " usage ",
- 3: " peakUsage ",
- }
- s = ''
- u = struct.unpack_from('<HHHHHH', buf, 0)
- s += rxbuf_name[1] + "%u %u %u %u %u %u\n" % u
- for i in range(2, 4):
- u = struct.unpack_from('<BBBBBB', buf, 6 * i)
- s += rxbuf_name[i] + "%u %u %u %u %u %u\n" % u
- return s
- mon_rxr_flags = {
- 1: "Awake",
- }
- def mon_rxr(self, buf):
- """UBX-MON-RXBUF decode, Receiver Status Information"""
-
- u = struct.unpack_from('<B', buf, 0)
- s = " flags: x%x" % u
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n flags (%s)" %
- index_s(u[0], self.mon_rxr_flags))
- return s
- mon_smgr_OscState = {
- 0: "autonomous operation",
- 1: "calibration ongoing",
- 2: "oscillator steered by host",
- 3: "idle state",
- }
- mon_smgr_Osc = {
- 0x10: "OscCalib",
- 0x20: "OscDisc",
- }
- mon_smgr_discSrc = {
- 0: "internal oscillator",
- 1: "GNSS",
- 2: "EXTINT0",
- 3: "EXTINT1",
- 4: "internal oscillator measured by host",
- 5: "external oscillator measured by host",
- }
- def mon_smgr(self, buf):
- """UBX-MON-SMGR decode, Synchronization manager status"""
- u = struct.unpack_from('<BBBBLHHBBBB', buf, 0)
- s = (" version %u reserved1 %u %u %u iTOW %u intOsc x%x extOsc x%x\n"
- " discOsc %u gnss x%x extInt0 x%x extInt1 x%x" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n intOsc (%s) intOscState (%s)"
- "\n extOsc(%s) extoscState (%s)"
- "\n flags (%s)" %
- (flag_s(u[3], self.mon_smgr_Osc),
- index_s(u[3] & 0x0f, self.mon_smgr_OscState),
- flag_s(u[4], self.mon_smgr_Osc),
- index_s(u[4] & 0x0f, self.mon_smgr_OscState),
- index_s(u[5], self.mon_smgr_discSrc)))
- return s
- def mon_txbuf(self, buf):
- """UBX-MON-TXBUF decode, Transmitter Buffer Status"""
- txbuf_name = {
- 1: " pending ",
- 2: " usage ",
- 3: " peakUsage ",
- }
- errors = {
- 0x40: "mem",
- 0x80: "alloc",
- }
- s = ''
- u = struct.unpack_from('<HHHHHH', buf, 0)
- s += txbuf_name[1] + "%u %u %u %u %u %u\n" % u
- for i in range(2, 4):
- u = struct.unpack_from('<BBBBBB', buf, 6 * i)
- s += txbuf_name[i] + "%u %u %u %u %u %u\n" % u
- u = struct.unpack_from('<BBBB', buf, 24)
- s += " tUsage %u tPeakUsage %u errors x%x reserved1 %u" % u
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n errors (%s) limit (%u)" %
- (flag_s(u[2], errors), u[2] & 0x3f))
- return s
- def mon_ver(self, buf):
- """UBX-MON-VER decode, Poll Receiver/Software Version"""
-
-
- m_len = len(buf)
- substr = buf.split(gps.polybytes('\0'))[0]
- substr1 = buf[30:39]
- substr1 = substr1.split(gps.polybytes('\0'))[0]
- s = (" swVersion %s\n"
- " hwVersion %s" %
- (gps.polystr(substr), gps.polystr(substr1)))
-
- protver = None
- num_ext = int((m_len - 40) / 30)
- for i in range(0, num_ext):
- loc = 40 + (i * 30)
- substr = buf[loc:]
- substr = substr.split(gps.polybytes('\0'))[0]
- polystr = gps.polystr(substr)
- s += '\n extension %s' % polystr
-
- if "PROTVER" == polystr[:7]:
- protver = "%.2f" % float(polystr[8:])
- opts_protver = "%.2f" % opts['protver']
- if protver and protver != opts_protver:
- s += ('\nWARNING: protVer is %s, should be %s.'
- ' Hint: use option "-P %s"' %
- (opts_protver, protver, protver))
-
- opts['protver'] = float(protver)
- return s
- mon_ids = {0x02: {'str': 'IO', 'dec': mon_io, 'minlen': 20,
- 'name': 'UBX-MON-IO'},
- 0x04: {'str': 'VER', 'dec': mon_ver, 'minlen': 40,
- 'name': 'UBX-MON-VER'},
- 0x06: {'str': 'MSGPP', 'dec': mon_msgpp, 'minlen': 120,
- 'name': 'UBX-MON-MSGPP'},
- 0x07: {'str': 'RXBUF', 'dec': mon_rxbuf, 'minlen': 24,
- 'name': 'UBX-MON-RXBUF'},
- 0x08: {'str': 'TXBUF', 'dec': mon_txbuf, 'minlen': 28,
- 'name': 'UBX-MON-TXBUF'},
- 0x09: {'str': 'HW', 'dec': mon_hw, 'minlen': 60,
- 'name': 'UBX-MON-HW'},
- 0x0b: {'str': 'HW2', 'dec': mon_hw2, 'minlen': 28,
- 'name': 'UBX-MON-HW2'},
- 0x21: {'str': 'RXR', 'dec': mon_rxr, 'minlen': 1,
- 'name': 'UBX-MON-RXR'},
- 0x27: {'str': 'PATCH', 'dec': mon_patch, 'minlen': 4,
- 'name': 'UBX-MON-PATCH'},
- 0x28: {'str': 'GNSS', 'dec': mon_gnss, 'minlen': 8,
- 'name': 'UBX-MON-GNSS'},
- 0x2e: {'str': 'SMGR', 'dec': mon_smgr, 'minlen': 16,
- 'name': 'UBX-MON-SMGR'},
- 0x32: {'str': 'BATCH', 'dec': mon_batch, 'minlen': 12,
- 'name': 'UBX-MON-BATCH'},
- 0x36: {'str': 'COMMS', 'dec': mon_comms, 'minlen': 8,
- 'name': 'UBX-MON-COMMS'},
- 0x37: {'str': 'HW3', 'dec': mon_hw3, 'minlen': 22,
- 'name': 'UBX-MON-HW3'},
- 0x38: {'str': 'RF', 'dec': mon_rf, 'minlen': 4,
- 'name': 'UBX-MON-RF'},
- }
- def nav_aopstatus(self, buf):
- """UBX-NAV-AOPSTATUS decode, AssistNow Autonomous Status"""
- u = struct.unpack_from('<LBBLLH', buf, 0)
- s = ' iTOW %u aopCfg %u status %u reserved1 %u %u %u' % u
- if VERB_DECODE <= opts['verbosity']:
- aopCfg = {1: "useAOP"}
- s += "\n aopCfg (%s)" % flag_s(u[1], aopCfg)
- return s
- def nav_att(self, buf):
- """UBX-NAV-ATT decode, Attitude Solution"""
- u = struct.unpack_from('<LBHBlllLLL', buf, 0)
- s = (" iTOW %u version %u reserved1 %u %u\n"
- " roll %d pitch %d heading %d\n"
- " accRoll %d accPitch %d accHeading %d" % u)
- return s
- def nav_clock(self, buf):
- """UBX-NAV-CLOCK decode, Clock Solution"""
- u = struct.unpack_from('<LllLL', buf, 0)
- return ' iTOW %u clkB %d clkD %d tAcc %u fAcc %u' % u
- nav_dgps_status = {
- 0: "None",
- 1: "PR+PRR correction",
- }
- def nav_dgps(self, buf):
- """UBX-NAV-DGPS decode, DGPS Data used for NAV"""
-
- u = struct.unpack_from('<LlhhBBH', buf, 0)
- s = (' iTOW %u age %d baseID %d basehealth %d numCh %u\n'
- ' status x%x reserved1 %u' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n status (%s)" %
- index_s(u[5], self.nav_dgps_status))
- for i in range(0, u[4]):
- u = struct.unpack_from('<BbHff', buf, 16 + i * 12)
- s += ('\n svid %3u flags x%2x ageC %u prc %f prcc %f' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n channel %u dgps %u" %
- (u[1] & 0x0f, (u[1] >> 4) & 1))
- return s
- def nav_dop(self, buf):
- """UBX-NAV-DOP decode, Dilution of Precision"""
- u = struct.unpack_from('<Lhhhhhhh', buf, 0)
- s = (' iTOW %u gDOP %u pDOP %u tDOP %u vDOP %u\n'
- ' hDOP %u nDOP %u eDOP %u' % u)
- return s
- def nav_eoe(self, buf):
- """UBX-NAV-EOE decode, End Of Epoch"""
- u = struct.unpack_from('<L', buf, 0)
- return ' iTOW %u' % u
- nav_geofence_state = {
- 1: "Inside",
- 2: "Outside",
- }
- nav_geofence_status = {
- 0: "n/a",
- 1: "Active",
- }
- def nav_geofence(self, buf):
- """UBX-NAV-GEOFENCE decode, Geofencing status"""
- u = struct.unpack_from('<LBBBB', buf, 0)
- s = ' iTOW:%u version %u status %u numFences %u combState %u' % u
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n status (%s) combState (%s)" %
- (index_s(u[2], self.nav_geofence_status),
- index_s(u[4], self.nav_geofence_state)))
- for i in range(0, u[3]):
- u = struct.unpack_from('<BB', buf, 8 + (i * 2))
- s += '\n state %u reserved1 %u' % u
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n state (%s)" %
- (index_s(u[0], self.nav_geofence_state)))
- return s
- def nav_hpposecef(self, buf):
- """UBX-NAV-POSECEF decode, High Precision Position Solution in ECEF"""
- u = struct.unpack_from('<BBBBLlllbbbbL', buf, 0)
- return (' version %u reserved1 %u %u %u iTOW %u\n'
- ' ecef: X %d Y %d Z %d\n'
- ' ecefHP: X %d Y %d Z %d\n'
- ' reserved2 %u pAcc %u' % u)
- def nav_hpposllh(self, buf):
- """UBX-NAV-HPPOSLLH decode, HP Geodetic Position Solution"""
- u = struct.unpack_from('<BBBBLllllbbbbLL', buf, 0)
- return (' version %u reserved1 %u %u %u iTOW %u\n'
- ' lon %d lat %d height %d hMSL %d\n'
- ' lonHp %d latHp %d heightHp %d hMSLHp %d\n'
- ' hAcc %u vAcc %u' % u)
- def nav_odo(self, buf):
- """UBX-NAV-ODO decode, Odometer Solution"""
- u = struct.unpack_from('<BBBBLLLL', buf, 0)
- return (" version %u reserved1 %u %u %u iTOW %u\n"
- " distance %u totalDistance %u distanceStd %u" % u)
- nav_orb_almUsability = {
- 0: "Unusable",
- 30: "> 30 days",
- 31: "Unknown",
- }
- nav_orb_ephUsability = {
- 0: "Unusable",
- 30: "> 450 mins",
- 31: "Unknown",
- }
- nav_orb_ephSource = {
- 0: "not available",
- 1: "GNSS transmission",
- 2: "external aiding",
- }
- nav_orb_type = {
- 0: "not available",
- 1: "Assist now offline data",
- 2: "Assist now autonomous data",
- }
- def nav_orb(self, buf):
- """UBX-NAV-ORB decode, GNSS Orbit Database Info"""
- u = struct.unpack_from('<LBBH', buf, 0)
- s = " iTOW %u version %u numSv %u reserved1 %u" % u
- for i in range(0, u[2]):
- u = struct.unpack_from('<BBBBBB', buf, 8 + (i * 6))
- s += ("\n gnssId %u svId %3u svFlag x%02x eph x%02x alm x%02x "
- "otherOrb x%x" % u)
- if VERB_DECODE <= opts['verbosity']:
- eph = int(u[3] & 0x1f)
- s1 = index_s(eph, self.nav_orb_ephUsability, nf="")
- if not s1:
- s1 = "%d to %d mins" % ((eph - 1) * 15, eph * 15)
- alm = int(u[4] & 0x1f)
- s2 = index_s(alm, self.nav_orb_almUsability, nf="")
- if not s2:
- s2 = "%d to %d days" % (alm - 1, alm)
- other = int(u[5] & 0x1f)
- s3 = index_s(other, self.nav_orb_almUsability, nf="")
- if not s3:
- s3 = "%d to %d days" % (other - 1, other)
- s += ("\n (%s:%u) health (%s) visibility (%s)"
- "\n ephUsability (%s) ephSource (%s)"
- "\n almUsability (%s) almSource (%s)"
- "\n anoAopUsability (%s) type (%s)" %
- (index_s(u[0], self.gnss_id), u[1],
- index_s(u[2] & 3, self.health),
- index_s((u[2] >> 2) & 3, self.visibility),
- s1,
- index_s(u[3] >> 5, self.nav_orb_ephSource, nf="other"),
- s2,
- index_s(u[4] >> 5, self.nav_orb_ephSource, nf="other"),
- s3,
- index_s(u[5] >> 5, self.nav_orb_type, nf="other")))
- return s
- def nav_posecef(self, buf):
- """UBX-NAV-POSECEF decode, Position Solution in ECEF"""
-
- u = struct.unpack_from('<LlllL', buf, 0)
- return ' iTOW %u ecefX %d Y %d Z %d pAcc %u' % u
- def nav_posllh(self, buf):
- """UBX-NAV-POSLLH decode, Geodetic Position Solution"""
- u = struct.unpack_from('<LllllLL', buf, 0)
- return (' iTOW %u lon %d lat %d height %d\n'
- ' hMSL %d hAcc %u vAcc %u' % u)
- nav_pvt_valid = {
- 1: "validDate",
- 2: "ValidTime",
- 4: "fullyResolved",
- 8: "validMag",
- }
-
- nav_pvt_fixType = {
- 0: 'None',
- 1: 'Dead Reckoning',
- 2: '2D',
- 3: '3D',
- 4: 'GPS+DR',
- 5: 'Surveyed',
- }
- nav_pvt_flags = {
- 1: "gnssFixOK",
- 2: "diffSoln",
- 0x20: "headVehValid",
- }
- nav_pvt_flags2 = {
- 0x20: "confirmedAvai",
- 0x40: "confirmedDate",
- 0x80: "confirmedTime",
- }
- nav_pvt_psm = {
- 0: "Not Active",
- 1: "Enabled",
- 2: "Acquisition",
- 3: "Tracking",
- 4: "Power Optimized Tracking",
- 5: "Inactive",
- }
-
- carrSoln = {
- 0: "None",
- 1: "Floating",
- 2: "Fixed",
- }
- def nav_pvt(self, buf):
- """UBX-NAV-PVT decode, Navigation Position Velocity Time Solution"""
- m_len = len(buf)
-
-
-
- u = struct.unpack_from('<LHBBBBBBLlBBBBllllLLlllllLLHHHH', buf, 0)
- s = (' iTOW %u time %u/%u/%u %02u:%02u:%02u valid x%x\n'
- ' tAcc %u nano %d fixType %u flags x%x flags2 x%x\n'
- ' numSV %u lon %d lat %d height %d\n'
- ' hMSL %d hAcc %u vAcc %u\n'
- ' velN %d velE %d velD %d gSpeed %d headMot %d\n'
- ' sAcc %u headAcc %u pDOP %u reserved1 %u %u %u' % u)
- if 92 <= m_len:
-
- u1 = struct.unpack_from('<lhH', buf, 81)
- s += ('\n headVeh %d magDec %d magAcc %u' % u1)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n valid (%s)"
- "\n fixType (%s)"
- "\n flags (%s)"
- "\n flags2 (%s)"
- "\n psmState (%s)"
- "\n carrSoln (%s)" %
- (flag_s(u[7], self.nav_pvt_valid),
- index_s(u[10], self.nav_pvt_fixType),
- flag_s(u[11], self.nav_pvt_flags),
- flag_s(u[12], self.nav_pvt_flags2),
- index_s((u[11] >> 2) & 0x0f, self.nav_pvt_psm),
- index_s((u[11] >> 6) & 0x03, self.carrSoln)))
- return s
- nav_relposned_flags = {
- 1: "gnssFixOK",
- 2: "diffSoln",
- 4: "relPosValid",
- 0x20: "isMoving",
- 0x40: "refPosMiss",
- 0x80: "refObsMiss",
- 0x100: "relPosHeadingValid",
- 0x200: "relPosNormalized",
- }
- def nav_relposned(self, buf):
- """UBX-NAV-RELPOSNED decode
- Relative Positioning Information in NED frame.
- protVer 20+ is 40 bytes
- protVer 27.11+ is 64 bytes, and things reordered, so not upward compatible
- High Precision GNSS products only."""
- m_len = len(buf)
-
- u = struct.unpack_from('<BBHLlll', buf, 0)
- s = (' version %u reserved1 %u refStationId %u iTOW %u\n'
- ' relPosN %d relPosE %d relPosD %d\n' % u)
- if (1 == u[0] and 64 <= m_len):
-
- u1 = struct.unpack_from('<llLbbbbLLLLLLL', buf, 20)
- s += (' relLength %d relHeading %d reserved2 %u\n'
- ' relPosHPN %d relPosHPE %d relPosHPD %d '
- 'relPosHPLength %d\n'
- ' accN %u accE %u accD %u accLength %u accHeading %u\n'
- ' reserved3 %u flags x%x' % u1)
- flags = u1[13]
- elif (0 == u[0] and 40 <= m_len):
-
- u1 = struct.unpack_from('<bbbbLLLLLLL', buf, 20)
- s += (' relPosHPN %d relPosHPE %d relPosHPD %d reserved2 %u\n'
- ' accN %u accE %u accD %u flags x%x' % u1)
- flags = u1[7]
- else:
-
- return " Bad Length %d version %u combination" % (m_len, u[0])
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n flags (%s)\n"
- " carrSoln (%s)" %
- (flag_s(flags, self.nav_relposned_flags),
- index_s((flags >> 3) & 0x03, self.carrSoln)))
- return s
- def nav_resetodo(self, buf):
- """UBX-NAV-RESETODO decode, reset odometer"""
- m_len = len(buf)
- if 0 == m_len:
- s = " reset request"
- else:
- s = " unexpected data"
- return s
- qualityInd = {
- 0: "None",
- 1: "Searching",
- 2: "Acquired",
- 3: "Detected",
- 4: "Code and time locked",
- 5: "Code, carrier and time locked",
- 6: "Code, carrier and time locked",
- 7: "Code, carrier and time locked",
- }
- health = {
- 0: "Unknown",
- 1: "Healthy",
- 2: "Unhealthy",
- }
- visibility = {
- 1: "below horizon",
- 2: "above horizon",
- 3: "above elevation mask",
- }
- nav_sat_orbit = {
- 0: "None",
- 1: "Ephemeris",
- 2: "Almanac",
- 3: "AssistNow Offline",
- 4: "AssistNow Autonomous",
- 5: "Other",
- 6: "Other",
- 7: "Other",
- }
- nav_sat_flags = {
- 8: "svUsed",
- 0x40: "diffCorr",
- 0x80: "smoothed",
- 0x800: "ephAvail",
- 0x1000: "almAvail",
- 0x2000: "anoAvail",
- 0x4000: "aopAvail",
- 0x10000: "sbasCorrUsed",
- 0x20000: "rtcmCorrUsed",
- 0x40000: "slasCorrUsed",
- 0x100000: "prCorrUsed",
- 0x200000: "crCorrUsed",
- 0x400000: "doCorrUsed",
- }
- def nav_sat(self, buf):
- """UBX-NAV-SAT decode"""
- u = struct.unpack_from('<LBBBB', buf, 0)
- s = ' iTOW %u version %u numSvs %u reserved1 %u %u' % u
- for i in range(0, u[2]):
- u = struct.unpack_from('<BBBbhhL', buf, 8 + (i * 12))
- s += ('\n gnssId %u svid %3u cno %2u elev %3d azim %3d prRes %6d'
- ' flags x%x' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n flags (%s)"
- "\n qualityInd x%x (%s) health (%s)"
- "\n orbitSource (%s)" %
- (flag_s(u[6], self.nav_sat_flags),
- u[6] & 7, index_s(u[6] & 7, self.qualityInd),
- index_s((u[6] >> 4) & 3, self.health),
- index_s((u[6] >> 8) & 7, self.nav_sat_orbit)))
- return s
- nav_sbas_mode = {
- 0: "Disabled",
- 1: "Enabled Integrity",
- 2: "Enabled Testmode",
- }
-
- nav_sbas_sys = {
- 0: "WAAS",
- 1: "EGNOS",
- 2: "MSAS",
- 3: "GAGAN",
- 4: "SDCM",
- 16: "GPS",
- }
- nav_sbas_service = {
- 1: "Ranging",
- 2: "Corrections",
- 4: "Integrity",
- 8: "Testmode",
- }
- def nav_sbas(self, buf):
- """UBX-NAV-SBAS decode, SBAS Status Data"""
-
-
-
- u = struct.unpack_from('<LBBbBBBBB', buf, 0)
- s = (" iTOW %d geo %u mode x%x sys %d service x%x cnt %u "
- "reserved0 %u %u %u" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n mode (%s) sys (%s)"
- "\n service (%s)" %
- (index_s(u[2], self.nav_sbas_mode),
- index_s(u[3], self.nav_sbas_sys),
- flag_s(u[4], self.nav_sbas_service)))
- for i in range(0, u[5]):
- u = struct.unpack_from('<BBBBBBhHh', buf, 12 + (i * 12))
- s += ("\n svid %3d flags x%04x udre x%02x svSys %3d svService %2d"
- " reserved2 %u"
- "\n prc %3d reserved3 %u ic %3d" % u)
- if VERB_DECODE <= opts['verbosity']:
-
- s += ("\n svSys (%s) svService (%s)" %
- (index_s(u[3], self.nav_sbas_sys),
- flag_s(u[4], self.nav_sbas_service)))
- return s
- nav_sig_corrSource = {
- 0: "None",
- 1: "SBAS",
- 2: "BeiDou",
- 3: "RTCM2",
- 4: "RTCM3 OSR",
- 5: "RTCM3 SSR",
- 6: "QZSS SLAS",
- }
- nav_sig_ionoModel = {
- 0: "None",
- 1: "Klobuchar over GPS",
- 2: "SBAS",
- 3: "Klobuchar over BeiDou",
- 8: "Dual Frequency obs",
- }
- nav_sig_sigFlags = {
- 4: "prSmoothed",
- 8: "prUsed",
- 0x10: "crUsed",
- 0x20: "doUsed",
- 0x40: "prCorrUsed",
- 0x80: "crCorrUsed",
- 0x100: "doCorrUsed",
- }
- def nav_sig(self, buf):
- """UBX-NAV-SIG decode, Signal Information"""
- u = struct.unpack_from('<LBBH', buf, 0)
- s = ' iTOW %u version %u numSigs %u reserved1 %u' % u
- for i in range(0, u[2]):
- u = struct.unpack_from('<BBBBhBBBBHL', buf, 8 + (i * 16))
- s += ('\n gnssId %u svId %u sigId %u freqId %u prRes %d cno %u '
- 'qualityInd %u\n'
- ' corrSource %u ionoModel %u sigFlags %#x reserved2 %u' %
- u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n (%s) corrSource (%s)"
- "\n qualityInd (%s)"
- "\n ionoModel (%s) health (%s)"
- "\n sigFlags (%s)" %
- (self.gnss_s(u[0], u[1], u[2]),
- index_s(u[7], self.nav_sig_corrSource),
- index_s(u[6], self.qualityInd),
- index_s(u[8], self.nav_sig_ionoModel),
- index_s(u[9] & 3, self.health),
- flag_s(u[9], self.nav_sig_sigFlags)))
- return s
- nav_slas_flags = {
- 1: "gmsAvailable",
- 2: "qzssSvAvailable",
- 4: "testMode",
- }
- def nav_slas(self, buf):
- """UBX-NAV-SLAS decode, QZSS L1S SLAS Status Data"""
- u = struct.unpack_from('<LBBBBllBBBB', buf, 0)
- s = (' iTOW %u version %u reserved1 %u %u %u'
- ' gmsLon %d gmsLon %d gmsCode %u qzssSvId %u'
- ' serviceFlags x%x cnt %d' % u)
- for i in range(0, u[8]):
- u = struct.unpack_from('<BBLh', buf, 20 + (i * 8))
- s += '\n gnssId %u svId %u reserved23 %u prc %d ' % u
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n flags (%s)" %
- (flag_s(u[3], self.nav_slas_flags)))
- return s
- nav_sol_flags = {
- 1: "GPSfixOK",
- 2: "DiffSoln",
- 4: "WKNSET",
- 8: "TOWSET",
- }
- def nav_sol(self, buf):
- """UBX-NAV-SOL decode, Navigation Solution Information"""
-
- u = struct.unpack_from('<LlhBBlllLlllLHBBL', buf, 0)
- s = (' iTOW %u fTOW %d week %d gpsFix %u flags x%x\n'
- ' ECEF X %d Y %d Z %d pAcc %u\n'
- ' VECEF X %d Y %d Z %d sAcc %u\n'
- ' pDOP %u reserved1 %u numSV %u reserved2 %u' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n gpsfix (%s)"
- "\n flags (%s)" %
- (index_s(u[3], self.nav_pvt_fixType),
- flag_s(u[4], self.nav_sol_flags)))
- return s
- def nav_status(self, buf):
- """UBX-NAV-STATUS decode"""
- u = struct.unpack_from('<LBBBBLL', buf, 0)
- return (' iTOW:%d ms, fix:%d flags:%#x fixstat:%#x flags2:%#x\n'
- ' ttff:%d, msss:%d' % u)
- def nav_svin(self, buf):
- """UBX-NAV-SVIN decode, Survey-in data"""
-
- u = struct.unpack_from('<BBBBLLlllbbbBLLBB', buf, 0)
- return (' version %u reserved1[%u %u %u] iTOW %u dur %u\n'
- ' meanX %d meanY %d meanZ %d\n'
- ' meanXHP %d meanYHP %d meanZHP %d reserved2 %u meanAcc %u\n'
- ' obs %u valid %u active %u' % u)
- def nav_svinfo(self, buf):
- """UBX-NAV-SVINFO decode"""
-
- m_len = len(buf)
- u = struct.unpack_from('<Lbb', buf, 0)
- s = ' iTOW:%d ms, numCh:%d globalFlags:%d' % u
- m_len -= 8
- i = 0
- while 0 < m_len:
- u = struct.unpack_from('<BBBBBbhl', buf, 8 + i * 12)
- s += ('\n chn %3d svid %3d flags %#0.2x quality %#x cno %2d'
- ' elev %3d azim %3d prRes %6d' % u)
- if 0 < u[2]:
- s += '\n '
- if 1 & u[2]:
- s += 'svUsed '
- if 2 & u[2]:
- s += 'diffCorr '
- if 4 & u[2]:
- s += 'orbitAvail '
- if 8 & u[2]:
- s += 'orbitEph '
- if 0x10 & u[2]:
- s += 'unhealthy '
- if 0x20 & u[2]:
- s += 'orbitAlm '
- if 0x40 & u[2]:
- s += 'orbitAop '
- if 0x80 & u[2]:
- s += 'smoothed '
- m_len -= 12
- i += 1
- return s
- nav_time_valid = {
- 1: "towValid",
- 2: "weekValid",
- 4: "leapValid",
- }
- def nav_timebds(self, buf):
- """UBX-NAV-TIMEBDS decode"""
- u = struct.unpack_from('<LLlhbBL', buf, 0)
- s = (" iTOW %d SOW %d fSOW %d week %d leapS %d\n"
- " Valid %#x tAcc %d" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n valid (%s)" %
- (flag_s(u[5], self.nav_time_valid)))
- return s
- def nav_timegal(self, buf):
- """UBX-NAV-TIMEGAL decode"""
- u = struct.unpack_from('<LLlhbBL', buf, 0)
- s = (" iTOW %d galTOW %d fGalTow %d galWno %d leapS %d\n"
- " Valid x%x, tAcc %d" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n valid (%s)" %
- (flag_s(u[5], self.nav_time_valid)))
- return s
- def nav_timeglo(self, buf):
- """UBX-NAV-TIMEGLO decode"""
- u = struct.unpack_from('<LLlhbBL', buf, 0)
- s = (" iTOW %d TOD %d fTOD %d Nt %d N4 %d\n"
- " Valid x%x tAcc %d" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n valid (%s)" %
- (flag_s(u[5], self.nav_time_valid)))
- return s
- def nav_timegps(self, buf):
- """UBX-NAV-TIMEGPS decode"""
- u = struct.unpack_from('<LlhbBL', buf, 0)
- s = " iTOW %u fTOW %u week %d leapS %d valid x%x tAcc %d" % u
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n valid (%s)" %
- (flag_s(u[4], self.nav_time_valid)))
- return s
- nav_timels_src = {
- 0: "Default",
- 1: "GPS/GLONASS derived",
- 2: "GPS",
- 3: "SBAS",
- 4: "BeiDou",
- 5: "Galileo",
- 6: "Aided data",
- 7: "Configured",
- }
- nav_timels_src1 = {
- 0: "None",
- 2: "GPS",
- 3: "SBAS",
- 4: "BeiDou",
- 5: "Galileo",
- 6: "GLONASS",
- }
- nav_timels_valid = {
- 1: "validCurrLs",
- 2: "validTimeToLsEvent",
- }
- def nav_timels(self, buf):
- """UBX-NAV-TIMELS decode, Leap second event information"""
- u = struct.unpack_from('<LBBBBBbBblHHBBBB', buf, 0)
- s = (' iTOW %u version %u reserved2 %u %u %u srcOfCurrLs %u\n'
- ' currLs %d srcOfLsChange %u lsChange %d timeToLsEvent %d\n'
- ' dateOfLsGpsWn %u dateOfLsGpsDn %u reserved2 %u %u %u\n'
- ' valid x%x' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n srcOfCurrLs (%s) srcOfLsChange (%s)"
- "\n valid (%s)" %
- (index_s(u[5], self.nav_timels_src),
- index_s(u[7], self.nav_timels_src1),
- flag_s(u[15], self.nav_timels_valid)))
- return s
- nav_timeutc_valid = {
- 1: "validTOW",
- 2: "validWKN",
- 4: "validUTC",
- }
- def nav_timeutc(self, buf):
- """UBX-NAV-TIMEUTC decode"""
- u = struct.unpack_from('<LLlHbbbbbB', buf, 0)
- s = (" iTOW %d tAcc %d nano %d Time %d/%d/%d %d:%d:%d\n"
- " valid x%x" % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ("\n valid (%s) utcStandard (%s)" %
- (flag_s(u[9], self.nav_timeutc_valid),
- index_s(u[9] >> 4, self.utc_std)))
- return s
- def nav_velecef(self, buf):
- """UBX-NAV-VELECEF decode"""
-
- u = struct.unpack_from('<LlllL', buf, 0)
- return ' iTOW %d ecef: VX %d VY %d VZ %d vAcc:%u' % u
- def nav_velned(self, buf):
- """UBX-NAV-VELNED decode."""
-
- u = struct.unpack_from('<LlllLLlLL', buf, 0)
- return (' iTOW %u vel: N %d E %d D %d speed %u\n'
- ' gspeed %u heading %d sAcc %u cAcc %u' % u)
- nav_ids = {0x01: {'str': 'POSECEF', 'dec': nav_posecef, 'minlen': 20,
- 'name': 'UBX-NAV-POSECEF'},
- 0x02: {'str': 'POSLLH', 'dec': nav_posllh, 'minlen': 20,
- 'name': 'UBX-NAV-POSLLH'},
- 0x03: {'str': 'STATUS', 'dec': nav_status, 'minlen': 16,
- 'name': 'UBX-NAV-STATUS'},
- 0x04: {'str': 'DOP', 'dec': nav_dop, 'minlen': 18,
- 'name': 'UBX-NAV-DOP'},
- 0x05: {'str': 'ATT', 'dec': nav_att, 'minlen': 32,
- 'name': 'UBX-NAV-ATT'},
- 0x06: {'str': 'SOL', 'dec': nav_sol, 'minlen': 52,
- 'name': 'UBX-NAV-SOL'},
- 0x07: {'str': 'PVT', 'dec': nav_pvt, 'minlen': 84,
- 'name': 'UBX-NAV-PVT'},
- 0x09: {'str': 'ODO', 'dec': nav_odo, 'minlen': 20,
- 'name': 'UBX-NAV-ODO'},
- 0x10: {'str': 'RESETODO', 'dec': nav_resetodo, 'minlen': 0,
- 'name': 'UBX-NAV-RESETODO'},
- 0x11: {'str': 'VELECEF', 'dec': nav_velecef, 'minlen': 20,
- 'name': 'UBX-NAV-VELECEF'},
- 0x12: {'str': 'VELNED', 'dec': nav_velned, 'minlen': 36,
- 'name': 'UBX-NAV-VELNED'},
- 0x13: {'str': 'HPPOSECEF', 'dec': nav_hpposecef, 'minlen': 28,
- 'name': 'UBX-NAV-HPPOSECEF'},
- 0x14: {'str': 'HPPOSLLH', 'dec': nav_hpposllh, 'minlen': 36,
- 'name': 'UBX-NAV-HPPOSLLH'},
- 0x20: {'str': 'TIMEGPS', 'dec': nav_timegps, 'minlen': 16,
- 'name': 'UBX-NAV-TIMEGPS'},
- 0x21: {'str': 'TIMEUTC', 'dec': nav_timeutc, 'minlen': 20,
- 'name': 'UBX-NAV-TIMEUTC'},
- 0x22: {'str': 'CLOCK', 'dec': nav_clock, 'minlen': 20,
- 'name': 'UBX-NAV-CLOCK'},
- 0x23: {'str': 'TIMEGLO', 'dec': nav_timeglo, 'minlen': 20,
- 'name': 'UBX-NAV-TIMEGLO'},
- 0x24: {'str': 'TIMEBDS', 'dec': nav_timebds, 'minlen': 20,
- 'name': 'UBX-NAV-TIMEBDS'},
- 0x25: {'str': 'TIMEGAL', 'dec': nav_timegal, 'minlen': 20,
- 'name': 'UBX-NAV-TIMEGAL'},
- 0x26: {'str': 'TIMELS', 'dec': nav_timels, 'minlen': 24,
- 'name': 'UBX-NAV-TIMELS'},
- 0x30: {'str': 'SVINFO', 'dec': nav_svinfo, 'minlen': 8,
- 'name': 'UBX-NAV-SVINFO'},
- 0x31: {'str': 'DGPS', 'dec': nav_dgps, 'minlen': 16,
- 'name': 'UBX-NAV-DGPS'},
- 0x32: {'str': 'SBAS', 'dec': nav_sbas, 'minlen': 12,
- 'name': 'UBX-NAV-SBAS'},
- 0x34: {'str': 'ORB', 'dec': nav_orb, 'minlen': 8,
- 'name': 'UBX-NAV-ORB'},
- 0x35: {'str': 'SAT', 'dec': nav_sat, 'minlen': 8,
- 'name': 'UBX-NAV-SAT'},
- 0x39: {'str': 'GEOFENCE', 'dec': nav_geofence, 'minlen': 8,
- 'name': 'UBX-NAV-GEOFENCE'},
- 0x3B: {'str': 'SVIN', 'dec': nav_svin, 'minlen': 40,
- 'name': 'UBX-NAV-SVIN'},
- 0x3C: {'str': 'RELPOSNED', 'dec': nav_relposned, 'minlen': 64,
- 'name': 'UBX-NAV-RELPOSNED'},
-
- 0x40: {'str': 'EKFSTATUS', 'minlen': 36,
- 'name': 'UBX-NAV-EKFSTATUS'},
- 0x42: {'str': 'SLAS', 'dec': nav_slas, 'minlen': 20,
- 'name': 'UBX-NAV-SLAS'},
- 0x43: {'str': 'SIG', 'dec': nav_sig, 'minlen': 8,
- 'name': 'UBX-NAV-SIG'},
- 0x60: {'str': 'AOPSTATUS', 'dec': nav_aopstatus, 'minlen': 16,
- 'name': 'UBX-NAV-AOPSTATUS'},
- 0x61: {'str': 'EOE', 'dec': nav_eoe, 'minlen': 4,
- 'name': 'UBX-NAV-EOE'},
- }
-
- rtcm_ids = {5: {'str': '1005'},
- 0x4a: {'str': '1074'},
- 0x4d: {'str': '1077'},
- 0x54: {'str': '1084'},
- 0x57: {'str': '1087'},
- 0x61: {'str': '1097'},
- 0x7c: {'str': '1124'},
- 0x7f: {'str': '1127'},
- 0xe6: {'str': '1230'},
- 0xfd: {'str': '4072-1'},
- 0xfe: {'str': '4072-0'},
- }
-
- nmea_ids = {0: {'str': 'GGA'},
- 1: {'str': 'GLL'},
- 2: {'str': 'GSA'},
- 3: {'str': 'GSV'},
- 4: {'str': 'RMC'},
- 5: {'str': 'VTG'},
- 6: {'str': 'GRS'},
- 7: {'str': 'GST'},
- 8: {'str': 'ZDA'},
- 9: {'str': 'GBS'},
- 0x0a: {'str': 'DTM'},
- 0x0d: {'str': 'GNS'},
- 0x0f: {'str': 'VLW'},
- 0x40: {'str': 'GPQ'},
- 0x41: {'str': 'TXT'},
- 0x42: {'str': 'GNQ'},
- 0x43: {'str': 'GLQ'},
- 0x44: {'str': 'GBQ'},
- 0x45: {'str': 'GAQ'},
- }
- def rxm_imes(self, buf):
- """UBX-RXM-IMES decode, Indoor Messaging System Information"""
- u = struct.unpack_from('<BBH', buf, 0)
- s = ' numTx %u version %u reserved1 %u' % u
- for i in range(0, u[0]):
- u = struct.unpack_from('<BBHBBHlLLLllLLL', buf, 4 + (i * 44))
- s += ('\n reserved %u txId %u reserved3 %u %u cno %u reserved4 %u'
- '\n doppler %d position1_1 x%x position1_2 x%x'
- '\n position2_1 x%x lat %d lon %d shortIdFrame x%x'
- '\n mediumIdLSB %u mediumId_2 x%x' % u)
- return s
- def rxm_measx(self, buf):
- """UBX-RXM-RAW decode"""
- m_len = len(buf)
- u = struct.unpack_from('<BBBBLLLLLHHHHHBBLL', buf, 0)
- s = (' version %u reserved1 %u %u %u gpsTOW %u gloTOW %u\n'
- ' bdsTOW %u reserved2 %u qzssTOW %u gpsTOWacc %u\n'
- ' gloTOWacc %u bdsTOWacc %u reserved3 %u qzssTOWacc %u\n'
- ' numSV %u flags %#x reserved4 %u %u' % u)
- m_len -= 44
- i = 0
- while 0 < m_len:
- u = struct.unpack_from('<BBBBllHHLBBH', buf, 44 + i * 24)
- s += ('\n gnssId %u svId %u cNo %u mpathIndic %u DopplerMS %d\n'
- ' dopplerHz %d wholeChips %u fracChips %u codephase %u\n'
- ' intCodePhase %u pseudoRangeRMSErr %u reserved5 %u' % u)
- m_len -= 24
- i += 1
- return s
- def rxm_raw(self, buf):
- """UBX-RXM-RAW decode"""
- m_len = len(buf)
- u = struct.unpack_from('<lhBB', buf, 0)
- s = ' iTOW %d weeks %d numSV %u res1 %u' % u
- m_len -= 8
- i = 0
- while 0 < m_len:
- u = struct.unpack_from('<ddfBbbB', buf, 8 + i * 24)
- s += ('\n cpMes %f prMes %f doMes %f sv %d mesQI %d\n'
- ' eno %d lli %d' % u)
- m_len -= 24
- i += 1
- return s
- rxm_rawx_recs = {
- 1: "leapSec",
- 2: "clkReset",
- }
- def rxm_rawx(self, buf):
- """UBX-RXM-RAWX decode"""
- m_len = len(buf)
-
- u = struct.unpack_from('<dHbBBBBB', buf, 0)
- s = (' rcvTow %.3f week %u leapS %d numMeas %u recStat %#x'
- ' version %u\n'
- ' reserved1[2] %#x %#x\n recStat (' % u)
- s += flag_s(u[4], self.rxm_rawx_recs) + ')'
- m_len -= 16
- i = 0
- while 0 < m_len:
- u = struct.unpack_from('<ddfBBBBHBBBBB', buf, 16 + i * 32)
- s += ('\n prmes %.3f cpMes %.3f doMes %f\n'
- ' gnssId %u svId %u sigId %u freqId %u locktime %u '
- 'cno %u\n'
- ' prStdev %u cpStdev %u doStdev %u trkStat %u' % u)
- if VERB_DECODE < opts['verbosity']:
- s += '\n (%s)' % self.gnss_s(u[3], u[4], u[5])
- m_len -= 32
- i += 1
- return s
- def rxm_rlm(self, buf):
- """UBX-RXM-RLM decode, Galileo SAR RLM report"""
- m_len = len(buf)
-
- u = struct.unpack_from('<BBBBLLB', buf, 0)
- s = (" version %u type %u svId %u reserved1 %u beacon x%x %x "
- " message %u" % u)
- if 16 == m_len:
-
- u = struct.unpack_from('<BBB', buf, 13)
- s += "\n params %u %u reserved2 %u" % u
- elif 28 == m_len:
-
- u = struct.unpack_from('<BBBBBBBBBBBBBBB', buf, 13)
- s += ("\n params %u %u %u %u %u %u %u %u %u %u %u %u"
- "\n reserved2 %u %u %u" % u)
- return s
- rxm_rtcm_flags = {
- 1: "crcFailed",
- }
- def rxm_rtcm(self, buf):
- """UBX-RXM-RTCM decode, RTCM Input Status"""
-
-
- u = struct.unpack_from('<BBHHH', buf, 0)
- s = " version %u flags x%x subtype %u refstation %u msgtype %u" % u
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n flags (%s)' % flag_s(u[1], self.rxm_rtcm_flags))
- return s
- def rxm_sfrb(self, buf):
- """UBX-RXM-SFRB decode, Subframe Buffer"""
- u = struct.unpack_from('<BBLLLLLLLLLL', buf, 0)
- s = (' chn %d s svid %3d\n'
- ' dwrd %08x %08x %08x %08x %08x\n'
- ' %08x %08x %08x %08x %08x' % u)
- return s
-
-
- def almanac(self, words):
- """Decode GPS Almanac"""
-
-
-
-
-
-
-
-
-
-
-
-
-
- s = " Almanac"
- s += ("\n e %e toa %u deltai %e Omegadot %e"
- "\n SVH x%x sqrtA %.6f Omega0 %e omega %e"
- "\n M0 %e af0 %e af1 %e" %
- (unpack_u16(words[2], 6) * (2 ** -21),
- unpack_u8(words[3], 22) * (2 ** 12),
- unpack_s16(words[3], 6) * (2 ** -19),
- unpack_s16(words[4], 14) * (2 ** -38),
- unpack_u8(words[4], 6),
- unpack_u24(words[5], 6) * (2 ** -11),
- unpack_s24(words[6], 6) * (2 ** -23),
- unpack_s24(words[7], 6) * (2 ** -23),
- unpack_s24(words[8], 6) * (2 ** -23),
- unpack_s11s(words[9]) * (2 ** -20),
- unpack_s11(words[9], 11) * (2 ** -38)))
- return s
- cnav_msgids = {
- 10: "Ephemeris 1",
- 11: "Ephemeris 2",
- 12: "Reduced Almanac",
- 13: "Clock Differential Correction",
- 14: "Ephemeris Differential Correction",
- 15: "Text",
- 30: "Clock, IONO & Group Delay",
- 31: "Clock & Reduced Almanac",
- 32: "Clock & EOP",
- 33: "Clock & UTC",
- 34: "Clock & Differential Correction",
- 35: "Clock & GGTO",
- 36: "Clock & Text",
- 37: "Clock & Midi Almanac",
- }
-
-
- sbfr4_svid_page = {
- 57: 1,
- 25: 2,
- 26: 3,
- 27: 4,
- 28: 5,
-
- 29: 7,
- 30: 8,
- 31: 9,
- 32: 10,
-
- 62: 12,
- 52: 13,
- 53: 14,
- 54: 15,
-
- 55: 17,
- 56: 18,
- 58: 19,
- 59: 20,
-
- 60: 22,
- 61: 23,
-
- 63: 25,
- }
-
-
-
- sbfr5_svid_page = {
- 1: 1,
- 2: 2,
- 3: 3,
- 4: 4,
- 5: 5,
- 6: 6,
- 7: 7,
- 8: 8,
- 9: 9,
- 10: 10,
- 11: 11,
- 12: 12,
- 13: 13,
- 14: 14,
- 15: 15,
- 16: 16,
- 17: 17,
- 18: 18,
- 19: 19,
- 20: 20,
- 21: 21,
- 22: 22,
- 23: 23,
- 24: 24,
- 51: 25,
- }
-
- ura_meters = {
- 0: "2.40 m",
- 1: "3.40 m",
- 2: "4.85 m",
- 3: "6.85 m",
- 4: "9.65 m",
- 5: "13.65 m",
- 6: "24.00 m",
- 7: "48.00 m",
- 8: "96.00 m",
- 9: "192.00 m",
- 10: "384.00 m",
- 11: "768.00 m",
- 12: "1536.00 m",
- 13: "3072.00 m",
- 14: "6144.00 m",
- 15: "Unk",
- }
- codes_on_l2 = {
- 0: "Invalid",
- 1: "P-code ON",
- 2: "C/A-code ON",
- 3: "Invalid",
- }
- nmct_ai = {
- 0: "OK",
- 1: "Encrypted",
- 2: "Unavailable",
- 3: "Reserved",
- }
- def rxm_sfrbx(self, buf):
- """UBX-RXM-SFRBX decode, Broadcast Navigation Data Subframe"""
-
-
- u = struct.unpack_from('<BBBBBBBB', buf, 0)
- svId = u[1]
- s = (' gnssId %u svId %3u reserved1 %u freqId %u numWords %u\n'
- ' chn %u version %u reserved2 %u\n' % u)
- s += ' dwrd'
- words = ()
- for i in range(0, u[4]):
- u1 = struct.unpack_from('<L', buf, 8 + (i * 4))
- if 6 == (i % 7):
- s += "\n "
- s += " %08x" % u1
- words += (u1[0],)
- if 0 == u[0]:
-
- preamble = words[0] >> 24
- if 0x8b == preamble:
-
- msgid = (words[0] >> 12) & 0x3f
- s += ("\n CNAV: preamble %#x PRN %u msgid %d (%s)\n" %
- (preamble, (words[0] >> 18) & 0x3f,
- msgid, index_s(msgid, self.cnav_msgids)))
- else:
-
-
-
- preamble = words[0] >> 22
- subframe = (words[1] >> 8) & 0x07
- s += ("\n LNAV-L: preamble %#x TLM %#x ISF %u" %
- (preamble, (words[0] >> 8) & 0xffff,
- 1 if (words[0] & 0x40) else 0))
- s += ("\n TOW %u AF %u ASF %u Subframe %u" %
- (unpack_u8(words[1], 13) * 6,
- 1 if (words[0] & 0x1000) else 0,
- 1 if (words[0] & 0x800) else 0,
- subframe))
- if 1 == subframe:
-
-
-
-
-
-
-
-
- ura = (words[2] >> 14) & 0x0f
- c_on_l2 = (words[2] >> 18) & 0x03
- iodc = ((((words[2] >> 6) & 0x03) << 8) |
- (words[7] >> 24) & 0xff)
- s += ("\n WN %u Codes on L2 %u (%s) URA %u (%s) "
- "SVH %#04x IODC %u" %
- (words[2] >> 20,
- c_on_l2, index_s(c_on_l2, self.codes_on_l2),
- ura, index_s(ura, self.ura_meters),
- (words[2] >> 8) & 0x3f, iodc))
-
- s += ("\n L2 P DF %u TGD %e tOC %u\n"
- " af2 %e af1 %e af0 %e" %
- ((words[2] >> 29) & 0x03,
- unpack_s8(words[6], 6) * (2 ** -31),
- unpack_u16(words[7], 6) * 16,
- unpack_s8(words[8], 22) * (2 ** -55),
- unpack_s16(words[8], 6) * (2 ** -43),
- unpack_s22(words[9], 8) * (2 ** -31)))
- elif 2 == subframe:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- s += ("\n IODE %u Crs %e Deltan %e M0 %e"
- "\n Cuc %e e %e Cus %e sqrtA %f"
- "\n tOE %u" %
- (unpack_u8(words[2], 22),
- unpack_s16(words[2], 6) * (2 ** -5),
- unpack_s16(words[3], 14) * (2 ** -43),
-
- unpack_s32s(words[4], words[3]) * (2 ** -31),
- unpack_s16(words[5], 14) * (2 ** -29),
- unpack_u32s(words[6], words[5]) * (2 ** -33),
- unpack_s16(words[7], 14) * (2 ** -29),
- unpack_u32s(words[8], words[7]) * (2 ** -19),
- unpack_u16(words[9], 14) * 16))
- elif 3 == subframe:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- s += ("\n Cic %e Omega0 %e Cis %e i0 %e"
- "\n Crc %e omega %e Omegadot %e"
- "\n IDOE %u IDOT %e" %
- (unpack_s16(words[2], 14) * (2 ** -29),
- unpack_s32s(words[3], words[2]) * (2 ** -31),
- unpack_s16(words[4], 14) * (2 ** -29),
- unpack_s32s(words[5], words[4]) * (2 ** -31),
-
- unpack_s16(words[6], 14) * (2 ** -5),
- unpack_s32s(words[7], words[6]) * (2 ** -31),
-
- unpack_s24(words[8], 6) * (2 ** -43),
- unpack_u8(words[9], 22),
- unpack_s14(words[9], 8) * (2 ** -43)))
- elif 4 == subframe:
-
-
-
-
-
-
-
-
-
-
- svid = (words[2] >> 22) & 0x3f
- if 0 == svid:
-
- page = "0/Dummy"
- else:
- page = index_s(svid, self.sbfr4_svid_page)
- s += ("\n dataid %u svid %u (page %s)\n" %
- (words[2] >> 28, svid, page))
- if 6 == page:
- s += " reserved"
- elif 2 <= page <= 10:
- s += self.almanac(words)
- elif 13 == page:
-
-
-
-
- s += (" NMCT AI %u(%s)"
- "\n ERD1: %s %s %s %s %s %s %s %s"
- "\n ERD9: %s %s %s %s %s %s %s %s"
- "\n ERD17: %s %s %s %s %s %s %s %s"
- "\n ERD25: %s %s %s %s %s %s" %
- ((words[2] >> 22) & 0x3,
- index_s((words[2] >> 22) & 0x3, self.nmct_ai),
- erd_s((words[2] >> 16) & 0x3f),
- erd_s((words[2] >> 8) & 0x3f),
- erd_s((((words[2] >> 2) & 0x30) |
- (words[3] >> 26) & 0x0f)),
- erd_s((words[3] >> 20) & 0x3f),
- erd_s((words[3] >> 14) & 0x3f),
- erd_s((words[3] >> 8) & 0x3f),
- erd_s((((words[3] >> 2) & 0x30) |
- (words[4] >> 26) & 0x0f)),
- erd_s((words[4] >> 20) & 0x3f),
- erd_s((words[4] >> 14) & 0x3f),
- erd_s((words[4] >> 8) & 0x3f),
- erd_s((((words[4] >> 2) & 0x30) |
- (words[5] >> 26) & 0x0f)),
- erd_s((words[5] >> 20) & 0x3f),
- erd_s((words[5] >> 14) & 0x3f),
- erd_s((words[5] >> 8) & 0x3f),
- erd_s((((words[5] >> 2) & 0x30) |
- (words[6] >> 26) & 0x0f)),
- erd_s((words[6] >> 20) & 0x3f),
- erd_s((words[6] >> 14) & 0x3f),
- erd_s((words[6] >> 8) & 0x3f),
- erd_s((((words[6] >> 2) & 0x30) |
- (words[7] >> 26) & 0x0f)),
- erd_s((words[7] >> 20) & 0x3f),
- erd_s((words[7] >> 14) & 0x3f),
- erd_s((words[7] >> 8) & 0x3f),
- erd_s((((words[7] >> 2) & 0x30) |
- (words[8] >> 26) & 0x0f)),
- erd_s((words[8] >> 20) & 0x3f),
- erd_s((words[8] >> 14) & 0x3f),
- erd_s((words[8] >> 8) & 0x3f),
- erd_s((((words[8] >> 2) & 0x30) |
- (words[9] >> 26) & 0x0f)),
- erd_s((words[9] >> 20) & 0x3f),
- erd_s((words[9] >> 14) & 0x3f),
- erd_s((words[9] >> 8) & 0x3f),
- ))
- elif 17 == page:
- s += (" Special messages: " +
- chr((words[2] >> 14) & 0xff) +
- chr((words[2] >> 6) & 0xff) +
- chr((words[3] >> 22) & 0xff) +
- chr((words[3] >> 14) & 0xff) +
- chr((words[3] >> 6) & 0xff) +
- chr((words[4] >> 22) & 0xff) +
- chr((words[4] >> 14) & 0xff) +
- chr((words[4] >> 6) & 0xff) +
- chr((words[5] >> 22) & 0xff) +
- chr((words[5] >> 14) & 0xff) +
- chr((words[5] >> 6) & 0xff) +
- chr((words[6] >> 22) & 0xff) +
- chr((words[6] >> 14) & 0xff) +
- chr((words[6] >> 6) & 0xff) +
- chr((words[7] >> 22) & 0xff) +
- chr((words[7] >> 14) & 0xff) +
- chr((words[7] >> 6) & 0xff) +
- chr((words[8] >> 22) & 0xff) +
- chr((words[8] >> 14) & 0xff) +
- chr((words[8] >> 6) & 0xff) +
- chr((words[9] >> 22) & 0xff) +
- chr((words[9] >> 14) & 0xff))
- elif 18 == page:
- s += " Ionospheric and UTC data"
- elif 25 == page:
- s += " A/S flags"
- else:
- s += " Reserved"
- elif 5 == subframe:
- svid = (words[2] >> 22) & 0x3f
- page = index_s(svid, self.sbfr5_svid_page)
- s += ("\n dataid %u svid %u (page %s)\n" %
- (words[2] >> 28, svid, page))
- if 1 <= page <= 24:
- s += self.almanac(words)
- elif 25 == page:
- s += " A/S flags"
- else:
- s += " Reserved"
- return s
- def rxm_svsi(self, buf):
- """UBX-RXM-SVSI decode, SV Status Info"""
- m_len = len(buf)
- u = struct.unpack_from('<LhBB', buf, 0)
- s = ' iTOW %d week %d numVis %d numSV %d' % u
- m_len -= 8
- i = 0
- while 0 < m_len:
- u = struct.unpack_from('<BBhbB', buf, 8 + i * 6)
- s += '\n svid %3d svFlag %#x azim %3d elev % 3d age %3d' % u
- m_len -= 6
- i += 1
- return s
- rxm_ids = {0x10: {'str': 'RAW', 'dec': rxm_raw, 'minlen': 8,
- 'name': 'UBX-RXM-RAW'},
- 0x11: {'str': 'SFRB', 'dec': rxm_sfrb, 'minlen': 42,
- 'name': 'UBX-RXM-SFRB'},
- 0x13: {'str': 'SFRBX', 'dec': rxm_sfrbx, 'minlen': 8,
- 'name': 'UBX-RXM-SFRBX'},
- 0x14: {'str': 'MEASX', 'dec': rxm_measx, 'minlen': 44,
- 'name': 'UBX-RXM-MEASX'},
- 0x15: {'str': 'RAWX', 'dec': rxm_rawx, 'minlen': 16,
- 'name': 'UBX-RXM-RAWX'},
- 0x20: {'str': 'SVSI', 'dec': rxm_svsi, 'minlen': 8,
- 'name': 'UBX-RXM-SVSI'},
-
- 0x30: {'str': 'ALM', 'minlen': 1, 'name': 'UBX-RXM-ALM'},
-
- 0x31: {'str': 'EPH', 'minlen': 1, 'name': 'UBX-RXM-EPH'},
- 0x32: {'str': 'RTCM', 'dec': rxm_rtcm, 'minlen': 8,
- 'name': 'UBX-RXM-RTCM'},
- 0x41: {'str': 'PMREQ', 'minlen': 8, 'name': 'UBX-RXM-PMREQ'},
- 0x59: {'str': 'RLM', 'dec': rxm_rlm, 'minlen': 16,
- 'name': 'UBX-RXM-RLM'},
- 0x61: {'str': 'IMES', 'dec': rxm_imes, 'minlen': 4,
- 'name': 'UBX-RXM-IMES'},
-
- 0x72: {'str': 'PMP', 'minlen': 24, 'name': 'UBX-RXM-PMP'},
- }
-
- def sec_uniqid(self, buf):
- """UBX-SEC_UNIQID decode Unique chip ID"""
-
- u = struct.unpack_from('<BBHBBBBB', buf, 0)
- s = (" version %u reserved %u %u uniqueId %#02x%02x%02x%02x%02x"
- % u)
- return s
- def sec_sign(self, buf):
- """UBX-SEC_SIGN decode, Signature of a previous message"""
-
- u = struct.unpack_from('<BBHBBH', buf, 0)
- s = (" version %u reserved %u %u classId x%x messageID x%x "
- " checksum %u\n hash " % u)
- s += gps.polystr(binascii.hexlify(buf[8:39]))
- return s
- sec_ids = {0x01: {'str': 'SIGN', 'minlen': 40, 'dec': sec_sign,
- 'name': 'UBX-SEC-SIGN'},
- 0x03: {'str': 'UNIQID', 'minlen': 9, 'dec': sec_uniqid,
- 'name': 'UBX-SEC-UNIQID'},
- }
-
- def tim_svin(self, buf):
- """UBX-TIM-SVIN decode, Survey-in data"""
- u = struct.unpack_from('<LlllLLBB', buf, 0)
- s = (' dur %u meanX %d meanY %d meanZ %d meanV %u\n'
- ' obs %u valid %u active %u' % u)
- return s
- def tim_tm2(self, buf):
- """UBX-TIM-TM2 decode, Time mark data"""
- u = struct.unpack_from('<BBHHHLLLLL', buf, 0)
- s = (' ch %u flags %#x count %u wnR %u wnF %u\n'
- ' towMsR %u towSubMsR %u towMsF %u towSubMsF %u accEst %u\n' % u)
- return s
- def tim_tp(self, buf):
- """UBX-TIM-TP decode, Time Pulse Timedata"""
- u = struct.unpack_from('<LLlHbb', buf, 0)
- s = (' towMS %u towSubMS %u qErr %d week %d\n'
- ' flags %#x refInfo %#x\n flags ' % u)
- if 0x01 & u[4]:
- s += "timeBase is UTC, "
- else:
- s += "timeBase is GNSS, "
- if 0x02 & u[4]:
- s += "UTC available, "
- else:
- s += "UTC not available, "
- raim = (u[4] >> 2) & 0x03
- if 0 == raim:
- s += "RAIM not available"
- elif 1 == raim:
- s += "RAIM not active"
- elif 2 == raim:
- s += "RAIM active"
- else:
- s += "RAIM ??"
- return s
- tim_vrfy_flags = {
- 0: "no time aiding done",
- 2: "source was RTC",
- 3: "source was AID-IN",
- }
- def tim_vrfy(self, buf):
- """UBX-TIM-VRFY decode, Sourced Time Verification"""
- u = struct.unpack_from('<llllHBB', buf, 0)
- s = (' itow %d frac %d deltaMs %d deltaMs %d\n'
- ' wno %u flags x%x reserved1 %u' % u)
- if VERB_DECODE <= opts['verbosity']:
- s += ('\n flags (%s)' %
- index_s(u[5] & 3, self.tim_vrfy_flags))
- return s
- tim_ids = {0x01: {'str': 'TP', 'dec': tim_tp, 'minlen': 16,
- 'name': 'UBX-TIM-TP'},
- 0x03: {'str': 'TM2', 'dec': tim_tm2, 'minlen': 28,
- 'name': 'UBX-TIM-TM2'},
- 0x04: {'str': 'SVIN', 'dec': tim_svin, 'minlen': 28,
- 'name': 'UBX-TIM-SVIN'},
- 0x06: {'str': 'VRFY', 'dec': tim_vrfy, 'minlen': 20,
- 'name': 'UBX-TIM-VRFY'},
-
- 0x11: {'str': 'DOSC', 'minlen': 8, 'name': 'UBX-TIM-DOSC'},
-
- 0x12: {'str': 'TOS', 'minlen': 56, 'name': 'UBX-TIM-TOS'},
-
- 0x13: {'str': 'SMEAS', 'minlen': 12, 'name': 'UBX-TIM-SMEAS'},
-
- 0x15: {'str': 'VCOCAL', 'minlen': 1, 'name': 'UBX-TIM-VCOCAL'},
-
- 0x16: {'str': 'FCHG', 'minlen': 32, 'name': 'UBX-TIM-FCHG'},
-
- 0x17: {'str': 'HOC', 'minlen': 8, 'name': 'UBX-TIM-HOC'},
- }
-
- upd_sos_cmd = {
- 0: "Create Backup File in Flash",
- 1: "Clear Backup in Flash",
- 2: "Backup File Creation Acknowledge",
- 3: "System Restored from Backup",
- }
- upd_sos_response2 = {
- 0: "Not Acknowledged",
- 1: "Acknowledged",
- }
- upd_sos_response3 = {
- 0: "Unknown",
- 1: "Failed restoring from backup file",
- 2: "Restored from backup file",
- 3: "Not restored (no backup)",
- }
- def upd_sos(self, buf):
- """UBX-UPD-SOS decode, Backup File stuff"""
- m_len = len(buf)
- if 0 == m_len:
- return " Poll Backup File Restore Status"
- if 4 > m_len:
- return " Bad Length %s" % m_len
- u = struct.unpack_from('<BBH', buf, 0)
- s = ' command %u reserved1 x%x %x' % u
- s1 = ""
- if 0 == u[0]:
-
- pass
- elif 1 == u[0]:
-
- pass
- elif 8 > m_len:
- s += " Bad Length %s" % m_len
- elif 2 == u[0]:
-
- u1 = struct.unpack_from('<BBH', buf, 4)
- s += '\n response %u reserved2 x%x %x' % u1
- s1 = ' response (%s)' % index_s(u1[0], self.upd_sos_response2)
- elif 3 == u[0]:
-
- u1 = struct.unpack_from('<BBH', buf, 4)
- s += '\n response %u reserved2 x%x %x' % u1
- s1 = ' response (%s)' % index_s(u1[0], self.upd_sos_response3)
- if VERB_DECODE <= opts['verbosity']:
- s += '\n cmd (%s)%s' % (index_s(u[0], self.upd_sos_cmd), s1)
- return s
- upd_ids = {
-
- 0x0c: {'str': 'undoc1', 'minlen': 13, 'name': "UBX-UPD-undoc1"},
- 0x14: {'str': 'SOS', 'dec': upd_sos, 'name': "UBX-UPD-SOS"},
-
- 0x25: {'str': 'undoc2', 'minlen': 20, 'name': "UBX-UPD-undoc2"},
- }
- classes = {
- 0x01: {'str': 'NAV', 'ids': nav_ids},
- 0x02: {'str': 'RXM', 'ids': rxm_ids},
- 0x04: {'str': 'INF', 'ids': inf_ids},
- 0x05: {'str': 'ACK', 'ids': ack_ids},
- 0x06: {'str': 'CFG', 'ids': cfg_ids},
- 0x09: {'str': 'UPD', 'ids': upd_ids},
- 0x0A: {'str': 'MON', 'ids': mon_ids},
- 0x0B: {'str': 'AID', 'ids': aid_ids},
- 0x0D: {'str': 'TIM', 'ids': tim_ids},
- 0x10: {'str': 'ESF', 'ids': esf_ids},
- 0x13: {'str': 'MGA', 'ids': mga_ids},
- 0x21: {'str': 'LOG', 'ids': log_ids},
- 0x27: {'str': 'SEC', 'ids': sec_ids},
- 0x28: {'str': 'HNR', 'ids': hnr_ids},
-
-
- 0xf0: {'str': 'NMEA', 'ids': nmea_ids},
- 0xf5: {'str': 'RTCM', 'ids': rtcm_ids},
- }
- def class_id_s(self, m_class, m_id):
- """Return class and ID numbers as a string."""
- s = 'Class x%02x' % (m_class)
- if (((m_class in self.classes and
- 'str' in self.classes[m_class]))):
- s += ' (%s)' % (self.classes[m_class]['str'])
- s += ' ID x%02x' % (m_id)
- if (((m_class in self.classes and
- 'ids' in self.classes[m_class] and
- m_id in self.classes[m_class]['ids'] and
- 'str' in self.classes[m_class]['ids'][m_id]))):
- s += ' (%s)' % (self.classes[m_class]['ids'][m_id]['str'])
- return s
- def decode_msg(self, out):
- """Decode one message and then return number of chars consumed"""
- state = 'BASE'
- consumed = 0
-
- for this_byte in out:
- consumed += 1
- if isinstance(this_byte, str):
-
- c = ord(this_byte)
- else:
-
- c = int(this_byte)
- if VERB_RAW <= opts['verbosity']:
- if ord(' ') <= c <= ord('~'):
-
- print("state: %s char %c (%#x)" % (state, chr(c), c))
- else:
-
- print("state: %s char %#x" % (state, c))
- if 'BASE' == state:
-
-
- comment = ''
- m_class = 0
- m_id = 0
- m_len = 0
- m_raw = bytearray(0)
- m_payload = bytearray(0)
- m_ck_a = 0
- m_ck_b = 0
- if 0xb5 == c:
-
- state = 'HEADER1'
- if ord('$') == c:
-
- state = 'NMEA'
- comment = '$'
- if ord("{") == c:
-
- state = 'JSON'
-
- comment = "{"
- continue
- if ord("#") == c:
-
- state = 'COMMENT'
-
- comment = "#"
- continue
- if 0xd3 == c:
-
- state = 'RTCM3_1'
-
- comment = "#"
- continue
- if (ord('\n') == c) or (ord('\r') == c):
-
- return 1
- continue
- if state in ('COMMENT', 'JSON'):
-
- if ord('\n') == c or ord('\r') == c:
-
-
-
- if gps.polystr('{"class":"ERROR"') in comment:
-
- if 0 < opts['timestamp']:
- timestamp()
- print(comment)
- elif VERB_DECODE <= opts['verbosity']:
- if 0 < opts['timestamp']:
- timestamp()
- print(comment)
- return consumed
-
- comment += chr(c)
- continue
- if 'NMEA' == state:
-
- if (ord('\n') == c) or (ord('\r') == c):
-
-
- if VERB_DECODE <= opts['verbosity']:
- if 0 < opts['timestamp']:
- timestamp()
- print(comment)
- return consumed
-
- comment += chr(c)
- continue
- if 'RTCM3_1' == state:
-
- if 0 != (c & 0xfc):
- state = 'BASE'
- else:
-
- m_len = c << 8
- state = 'RTCM3_2'
- m_raw.extend([c])
- continue
- if 'RTCM3_2' == state:
-
- m_len |= 0xff & c
-
- m_len += 3
- state = 'RTCM3_PAYLOAD'
- m_raw.extend([c])
- continue
- if 'RTCM3_PAYLOAD' == state:
- m_len -= 1
- m_raw.extend([c])
- m_payload.extend([c])
- if 0 == m_len:
- state = 'BASE'
- ptype = m_payload[0] << 4
- ptype |= 0x0f & (m_payload[1] >> 4)
- if VERB_DECODE <= opts['verbosity']:
- print("RTCM3 packet: type %d\n" % ptype)
- continue
- if ord('b') == c and 'HEADER1' == state:
-
- state = 'HEADER2'
- continue
- if 'HEADER2' == state:
-
- state = 'CLASS'
- m_class = c
- m_raw.extend([c])
- continue
- if 'CLASS' == state:
-
- state = 'ID'
- m_id = c
- m_raw.extend([c])
- continue
- if 'ID' == state:
-
- state = 'LEN1'
- m_len = c
- m_raw.extend([c])
- continue
- if 'LEN1' == state:
-
- m_raw.extend([c])
- m_len += 256 * c
- if 0 == m_len:
-
- state = 'CSUM1'
- else:
- state = 'PAYLOAD'
- continue
- if 'PAYLOAD' == state:
-
- m_raw.extend([c])
- m_payload.extend([c])
- if len(m_payload) == m_len:
- state = 'CSUM1'
- continue
- if 'CSUM1' == state:
-
- state = 'CSUM2'
- m_ck_a = c
- continue
- if 'CSUM2' == state:
-
- if 0 < opts['timestamp']:
- timestamp()
-
- state = 'BASE'
- m_ck_b = c
-
- chk = self.checksum(m_raw, len(m_raw))
- if (chk[0] != m_ck_a) or (chk[1] != m_ck_b):
- print("%s: ERROR checksum failed,"
- "was (%d,%d) s/b (%d, %d)\n" %
- (PROG_NAME, m_ck_a, m_ck_b, chk[0], chk[1]))
- s_payload = ''.join('{:02x} '.format(x) for x in m_payload)
- x_payload = ','.join(['%02x' % x for x in m_payload])
- if m_class in self.classes:
- this_class = self.classes[m_class]
- if 'ids' in this_class:
- if m_id in this_class['ids']:
-
-
- s_payload = this_class['ids'][m_id]['name']
- s_payload += ':\n'
- if ((('minlen' in this_class['ids'][m_id]) and
- (0 == m_len) and
- (0 != this_class['ids'][m_id]['minlen']))):
- s_payload += " Poll request"
- elif (('minlen' in this_class['ids'][m_id]) and
- (this_class['ids'][m_id]['minlen'] >
- m_len)):
-
- s_payload += " Bad Length %s" % m_len
- elif 'dec' in this_class['ids'][m_id]:
-
- dec = this_class['ids'][m_id]['dec']
- s_payload += dec(self, m_payload)
- else:
- s_payload += (" len %#x, raw %s" %
- (m_len, x_payload))
- if not s_payload:
-
- s_payload = ("%s, len %#x, raw %s" %
- (self.class_id_s(m_class, m_id),
- m_len, x_payload))
- if VERB_INFO <= opts['verbosity']:
- print("%s, len: %#x" %
- (self.class_id_s(m_class, m_id), m_len))
- x_raw = ','.join(['%02x' % x for x in m_raw[0:4]])
- print("header: b5,62,%s" % x_raw)
- print("payload: %s" % x_payload)
- print("chksum: %02x,%02x" % (m_ck_a, m_ck_b))
- print("%s\n" % s_payload)
- return consumed
-
- state = 'BASE'
-
- return 0
- def checksum(self, msg, m_len):
- """Calculate u-blox message checksum"""
-
-
- ck_a = 0
- ck_b = 0
- for c in msg[0:m_len]:
- ck_a += c
- ck_b += ck_a
- return [ck_a & 0xff, ck_b & 0xff]
- def make_pkt(self, m_class, m_id, m_data):
- """Make a message packet"""
-
- m_len = len(m_data)
-
- msg = bytearray(m_len + 6)
- struct.pack_into('<BBH', msg, 0, m_class, m_id, m_len)
-
- i = 0
- while i < m_len:
- msg[i + 4] = m_data[i]
- i += 1
-
- chk = self.checksum(msg, m_len + 4)
- m_chk = bytearray(2)
- struct.pack_into('<BB', m_chk, 0, chk[0], chk[1])
- header = b"\xb5\x62"
- return header + msg[:m_len + 4] + m_chk
- def gps_send(self, m_class, m_id, m_data):
- """Build, and send, a message to GPS"""
- m_all = self.make_pkt(m_class, m_id, m_data)
- self.gps_send_raw(m_all)
- def gps_send_raw(self, m_all):
- """Send a raw message to GPS"""
- if not opts['read_only']:
- io_handle.ser.write(m_all)
- if VERB_QUIET < opts['verbosity']:
- sys.stdout.write("sent:\n")
- if VERB_INFO < opts['verbosity']:
- sys.stdout.write(gps.polystr(binascii.hexlify(m_all)))
- sys.stdout.write("\n")
- self.decode_msg(m_all)
- sys.stdout.flush()
- def send_able_cfg_batch(self, able, args):
- """dis/enable batching, UBX-CFG-BATCH"""
- flags = 0x0d if able else 0x0c
- m_data = []
- struct.pack_into('<BBHHBB', m_data, 0, 0, flags, 128, 0, 0, 0)
- gps_model.gps_send(6, 0x93, m_data)
- def send_able_beidou(self, able, args):
- """dis/enable BeiDou"""
-
-
- gps_model.send_cfg_gnss1(3, able, args)
- def send_able_binary(self, able, args):
- """dis/enable basic binary messages. -e/-d BINARY"""
-
-
- rate = 1 if able else 0
-
- m_data = bytearray([0x01, 0x04, rate])
- gps_model.gps_send(6, 1, m_data)
- if 15 > opts['protver']:
-
- m_data = bytearray([0x01, 0x06, rate])
- gps_model.gps_send(6, 1, m_data)
- else:
-
- m_data = bytearray([0x01, 0x07, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0x01, 0x06, 0])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0x01, 0x01, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0x01, 0x11, rate])
- gps_model.gps_send(6, 1, m_data)
-
-
-
-
- m_data = bytearray([0x01, 0x20, rate])
- gps_model.gps_send(6, 1, m_data)
-
-
- if rate:
- rate_s = 10
- else:
- rate_s = 0
- if 27 > opts['protver']:
-
- m_data = bytearray([0x01, 0x32, rate_s])
- gps_model.gps_send(6, 1, m_data)
-
- if 15 > opts['protver']:
-
- m_data = bytearray([0x01, 0x30, rate_s])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0x01, 0x35, 0])
- gps_model.gps_send(6, 1, m_data)
- else:
-
- m_data = bytearray([0x01, 0x35, rate_s])
- gps_model.gps_send(6, 1, m_data)
- if 27 > opts['protver']:
-
- m_data = bytearray([0x01, 0x30, 0])
- gps_model.gps_send(6, 1, m_data)
- if 18 <= opts['protver']:
-
-
- m_data = bytearray([0x01, 0x61, rate])
- gps_model.gps_send(6, 1, m_data)
- if not able and 15 <= opts['protver']:
-
- m_data = bytearray([0x01, 0x12, 0])
- gps_model.gps_send(6, 1, m_data)
- def send_able_ecef(self, able, args):
- """Enable ECEF messages"""
-
- gps_model.send_cfg_msg(1, 1, able)
-
- gps_model.send_cfg_msg(1, 0x11, able)
- def send_able_gps(self, able, args):
- """dis/enable GPS/QZSS"""
-
-
- gps_model.send_cfg_gnss1(0, able, args)
-
- gps_model.send_cfg_gnss1(5, able, args)
- def send_able_galileo(self, able, args):
- """dis/enable GALILEO"""
- gps_model.send_cfg_gnss1(2, able, args)
- def send_able_glonass(self, able, args):
- """dis/enable GLONASS"""
-
-
- gps_model.send_cfg_gnss1(6, able, args)
- def send_able_logfilter(self, able, args):
- """Enable logging"""
- if able:
- m_data = bytearray([1,
- 5,
-
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0, 0, 0
- ])
- else:
- m_data = bytearray([1,
- 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0, 0, 0
- ])
-
- gps_model.gps_send(6, 0x47, m_data)
- def send_able_ned(self, able, args):
- """Enable NAV-RELPOSNED and VELNED messages.
- protver 15+ required for VELNED
- protver 20+, and HP GNSS, required for RELPOSNED"""
- if 15 > opts['protver']:
- sys.stderr.write('%s: WARNING: protver %d too low for NED\n' %
- (PROG_NAME, opts['protver']))
- return
-
- gps_model.send_cfg_msg(1, 0x12, able)
- if 20 > opts['protver']:
- sys.stderr.write('%s: WARNING: protver %d too low for '
- 'RELPOSNED\n' %
- (PROG_NAME, opts['protver']))
- return
-
- gps_model.send_cfg_msg(1, 0x3C, able)
- def send_able_nmea(self, able, args):
- """dis/enable basic NMEA messages"""
-
-
- rate = 1 if able else 0
-
- m_data = bytearray([0xf0, 0x09, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0xf0, 0x00, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0xf0, 0x01, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0xf0, 0x02, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0xf0, 0x07, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0xf0, 0x03, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0xf0, 0x04, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0xf0, 0x05, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0xf0, 0x08, rate])
- gps_model.gps_send(6, 1, m_data)
- def send_able_rtcm3(self, able, args):
- """dis/enable RTCM3 1005, 1077, 1087, 1230 messages"""
-
-
-
- if able:
- rate = 1
-
-
-
-
- m_data = bytearray(20)
- m_data[0] = 0x03
- m_data[12] = 0x27
-
-
- m_data[14] = 0x23
- gps_model.gps_send(0x06, 0x00, m_data)
- else:
-
- rate = 0
-
- m_data = bytearray([0xf5, 0x05, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0xf5, 0x4d, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0xf5, 0x57, rate])
- gps_model.gps_send(6, 1, m_data)
-
- m_data = bytearray([0xf5, 0xe6, rate])
- gps_model.gps_send(6, 1, m_data)
-
-
-
- m_data = bytearray([0xf5, 0xfe, rate])
-
- m_data = bytearray([0xf5, 0xfd, rate])
- gps_model.gps_send(6, 1, m_data)
- def send_able_rawx(self, able, args):
- """dis/enable UBX-RXM-RAW/RAWXX"""
- rate = 1 if able else 0
- if 15 > opts['protver']:
-
- sid = 0x10
- else:
-
- sid = 0x15
- m_data = bytearray([0x2, sid, rate])
- gps_model.gps_send(6, 1, m_data)
- def send_able_pps(self, able, args):
- """dis/enable PPS, using UBX-CFG-TP5"""
- m_data = bytearray(32)
- m_data[0] = 0
- m_data[1] = 1
- m_data[2] = 0
- m_data[3] = 0
- m_data[4] = 2
- m_data[5] = 0
- m_data[6] = 0
- m_data[7] = 0
- m_data[8] = 0x40
- m_data[9] = 0x42
- m_data[10] = 0x0f
- m_data[11] = 0
- m_data[12] = 0x40
- m_data[13] = 0x42
- m_data[14] = 0x0f
- m_data[15] = 0
- m_data[16] = 0
- m_data[17] = 0
- m_data[18] = 0
- m_data[19] = 0
- m_data[20] = 0xa0
- m_data[21] = 0x86
- m_data[22] = 0x1
- m_data[23] = 0
- m_data[24] = 0
- m_data[25] = 0
- m_data[26] = 0
- m_data[27] = 0
- m_data[28] = 0x77
- m_data[29] = 0
- m_data[30] = 0
- m_data[31] = 0
- if not able:
- m_data[28] &= ~1
- gps_model.gps_send(6, 0x31, m_data)
- def send_able_sbas(self, able, args):
- """dis/enable SBAS"""
- gps_model.send_cfg_gnss1(1, able, args)
- def send_able_sfrbx(self, able, args):
- """dis/enable UBX-RXM-SFRB/SFRBX"""
- rate = 1 if able else 0
- if 15 > opts['protver']:
-
- sid = 0x11
- else:
-
- sid = 0x13
- m_data = bytearray([0x2, sid, rate])
- gps_model.gps_send(6, 1, m_data)
- def send_able_tmode2(self, able, args):
- """SURVEYIN, UBX-CFG-TMODE2, set time mode 2 config"""
- m_data = bytearray(28)
-
-
-
-
-
-
-
- seconds = 300
-
-
- mmeters = 50000
- if able:
-
- m_data[0] = 1
- if args and len(args[0]):
- seconds = int(args[0])
- if 1 < len(args) and len(args[1]):
- mmeters = int(args[1])
- struct.pack_into('<LL', m_data, 20, seconds, mmeters)
- gps_model.gps_send(6, 0x3d, m_data)
- def send_able_tmode3(self, able, args):
- """SURVEYIN3, UBX-CFG-TMODE3, set time mode 3 config"""
- m_data = bytearray(40)
-
- seconds = 300
-
-
-
- mmeters = 500000
- if able:
-
- m_data[2] = 1
- if args and len(args[0]):
- seconds = int(args[0])
- if 1 < len(args) and len(args[1]):
- mmeters = int(args[1])
- struct.pack_into('<LL', m_data, 24, seconds, mmeters)
- gps_model.gps_send(6, 0x71, m_data)
- def send_able_tp(self, able, args):
- """dis/enable UBX-TIM-TP Time Pulse"""
- rate = 1 if able else 0
- m_data = bytearray([0xd, 0x1, rate])
- gps_model.gps_send(6, 1, m_data)
- def send_cfg_cfg(self, save_clear, args=[]):
- """UBX-CFG-CFG, save config"""
-
-
-
-
- cfg1 = 0x1f
-
- cfg2 = 0x0f
- m_data = bytearray(13)
-
-
- if 0 == save_clear:
-
- m_data[0] = 0
- m_data[1] = 0
- else:
-
- m_data[0] = cfg1
- m_data[1] = cfg2
- m_data[2] = 0
- m_data[3] = 0
-
-
- if 0 == save_clear:
-
- m_data[4] = cfg1
- m_data[5] = cfg2
- else:
-
- m_data[4] = 0
- m_data[5] = 0
- m_data[6] = 0
- m_data[7] = 0
-
-
- if False and 0 == save_clear:
-
- m_data[8] = 0
- m_data[9] = 0
- else:
-
- m_data[8] = cfg1
- m_data[9] = cfg2
- m_data[10] = 0
- m_data[11] = 0
-
-
- m_data[12] = 0x17
- gps_model.gps_send(6, 0x9, m_data)
- def send_cfg_gnss1(self, gnssId, enable, args):
- """UBX-CFG-GNSS, set GNSS config
- WARNING: the receiver will ACK, then ignore, many seemingly valid settings.
- Always double check with "-p CFG-GNSS".
- """
-
-
- m_data = bytearray(12)
- m_data[0] = 0
- m_data[1] = 0
- m_data[2] = 0xFF
- m_data[3] = 1
-
- m_data[4] = gnssId
-
-
- m_data[7] = 0
- m_data[8] = enable
- m_data[9] = 0
-
- if args:
- parm1 = args[0]
- else:
- parm1 = ''
- if 0 == gnssId:
-
- m_data[5] = 8
- m_data[6] = 16
- if '2' == parm1 and enable:
-
- m_data[10] = 0x11
- else:
- m_data[10] = 0x01
- elif 1 == gnssId:
-
- m_data[5] = 1
- m_data[6] = 3
- m_data[10] = 1
- elif 2 == gnssId:
-
- m_data[5] = 4
- m_data[6] = 8
- if '2' == parm1 and enable:
-
- m_data[10] = 0x21
- else:
- m_data[10] = 0x01
- elif 3 == gnssId:
-
- m_data[5] = 2
- m_data[6] = 16
- if '2' == parm1 and enable:
-
- m_data[10] = 0x11
- else:
- m_data[10] = 0x01
- elif 4 == gnssId:
-
- m_data[5] = 0
- m_data[6] = 8
- m_data[10] = 1
- elif 5 == gnssId:
-
- m_data[5] = 0
- m_data[6] = 3
- if '2' == parm1 and enable:
-
- m_data[10] = 0x15
- else:
- m_data[10] = 0x05
- elif 6 == gnssId:
-
- m_data[5] = 8
- m_data[6] = 14
- if '2' == parm1 and enable:
-
- m_data[10] = 0x11
- else:
- m_data[10] = 0x01
- else:
-
- m_data[10] = 1
- m_data[11] = 0
- gps_model.gps_send(6, 0x3e, m_data)
- def poll_cfg_inf(self):
- """UBX-CFG-INF, poll"""
- m_data = bytearray(1)
- m_data[0] = 0
- gps_model.gps_send(6, 0x02, m_data)
- m_data[0] = 1
- gps_model.gps_send(6, 0x02, m_data)
- def send_poll_cfg_msg(self, args):
- """UBX-CFG-MSG, mandatory args: class, ID, optional rate"""
- if 0 == len(args):
- sys.stderr.write('%s: ERROR: CFG-MSG missing class\n' %
- (PROG_NAME))
- sys.exit(1)
- if 1 == len(args):
- sys.stderr.write('%s: ERROR: CFG-MSG,x%x missing ID\n' %
- (PROG_NAME, args[0]))
- sys.exit(1)
- if 2 < len(args):
-
- m_data = bytearray(3)
- m_data[2] = int(args[2])
- else:
- m_data = bytearray(2)
- m_data[0] = int(args[0])
- m_data[1] = int(args[1])
- gps_model.gps_send(6, 1, m_data)
- def send_cfg_nav5_model(self, args):
- """MODEL, UBX-CFG-NAV5, set dynamic platform model"""
- m_data = bytearray(36)
- if 0 < len(args):
- m_data[0] = 1
- m_data[1] = 0
- m_data[2] = int(args[0])
-
-
- gps_model.gps_send(6, 0x24, m_data)
- def send_cfg_msg(self, m_class, m_id, rate=None):
- """UBX-CFG-MSG, poll, or set, message rates decode"""
- m_data = bytearray(2)
- m_data[0] = m_class
- m_data[1] = m_id
- if rate is not None:
- m_data.extend([rate])
- gps_model.gps_send(6, 1, m_data)
- def send_cfg_pms(self, args):
- """UBX-CFG-PMS, poll/set Power Management Settings"""
- if 0 < len(args):
- m_data = bytearray(8)
-
- m_data[1] = int(args[0])
-
- else:
-
- m_data = []
- gps_model.gps_send(6, 0x86, m_data)
- def send_cfg_prt(self, args=None):
- """UBX-CFG-PRT, get I/O Port settings"""
- if 0 == len(args):
-
- m_data = []
- else:
-
-
- m_data = bytearray([int(args[0])])
- gps_model.gps_send(6, 0x0, m_data)
- def send_cfg_rate(self, args):
- """UBX-CFG-RATE, poll/set rate settings"""
- if 0 == len(args):
-
- gps_model.gps_send(6, 0x08, [])
- return
- m_data = bytearray(6)
- measRate = int(args[0])
- navRate = 1
- timeRef = 1
- if 1 < len(args):
- navRate = int(args[1])
- if 2 < len(args):
- timeRef = int(args[2])
- struct.pack_into('<HHH', m_data, 0, measRate, navRate, timeRef)
- gps_model.gps_send(6, 0x08, m_data)
- def send_cfg_rst(self, reset_type):
- """UBX-CFG-RST, reset"""
-
-
-
- m_data = bytearray(4)
- m_data[0] = reset_type & 0xff
- m_data[1] = (reset_type >> 8) & 0xff
- gps_model.gps_send(6, 0x4, m_data)
- def send_cfg_rxm(self, args):
- """UBX-CFG-RXM, poll/set low power mode"""
- if 0 == len(args):
-
- m_data = []
- else:
-
- m_data = bytearray([0, int(args[0])])
- gps_model.gps_send(6, 0x11, m_data)
- def send_cfg_slas(self, args):
- """UBX-CFG-SLAS, poll/set SLAS mode"""
- if 0 == len(args):
-
- m_data = []
- else:
-
- m_data = bytearray(4)
- m_data[0] = int(args[0])
- gps_model.gps_send(6, 0x8d, m_data)
- def send_cfg_tp5(self, args):
- """UBX-CFG-TP5, get time0 decodes"""
- if 0 == len(args):
-
- m_data = []
- else:
-
- m_data = bytearray([int(args[0])])
- gps_model.gps_send(6, 0x31, m_data)
- def send_set_speed(self, speed):
- """"UBX-CFG-PRT, set port"""
- port = opts['port']
-
- if port is None:
- port = 1
- if port not in set([1, 2]):
- sys.stderr.write('%s: Invalid UART port - %d\n' %
- (PROG_NAME, port))
- sys.exit(2)
-
- m_data = bytearray(20)
- m_data[0] = port
- m_data[4] = 0xc0
- m_data[5] = 0x8
- m_data[8] = speed & 0xff
- m_data[9] = (speed >> 8) & 0xff
- m_data[10] = (speed >> 16) & 0xff
- m_data[11] = (speed >> 24) & 0xff
- m_data[12] = 3
- m_data[14] = 3
- gps_model.gps_send(6, 0, m_data)
- def send_cfg_valdel(self, keys):
- """UBX-CFG-VALDEL, delete config items by key"""
-
-
- m_data = bytearray(4)
- m_data[0] = 0
- m_data[1] = 6
-
-
- for key in keys:
- k_data = bytearray(4)
- k_data[0] = (key) & 0xff
- k_data[1] = (key >> 8) & 0xff
- k_data[2] = (key >> 16) & 0xff
- k_data[3] = (key >> 24) & 0xff
- m_data.extend(k_data)
- gps_model.gps_send(0x06, 0x8c, m_data)
- def send_cfg_valget(self, keys, layer, position):
- """UBX-CFG-VALGET, get config items by key"""
-
-
- m_data = bytearray(4)
-
-
-
- struct.pack_into('<BBH', m_data, 0, 0, 0, position)
- k_data = bytearray(4)
- for key in keys:
- struct.pack_into('<L', k_data, 0, key)
- m_data.extend(k_data)
- if layer is None:
-
- layers = set([0, 1, 2, 7])
- for layer in layers:
- m_data[1] = layer
- gps_model.gps_send(0x06, 0x8b, m_data)
- else:
- m_data[1] = layer
- gps_model.gps_send(0x06, 0x8b, m_data)
- def send_cfg_valset(self, nvs):
- """UBX-CFG-VALSET, set config items by key/val pairs"""
-
-
- m_data = bytearray(4)
- m_data[0] = 0
- m_data[1] = 0x7
- for nv in nvs:
- size = 4
- nv_split = nv.split(',')
- name = nv_split[0]
- val = nv_split[1]
- if 3 <= len(nv_split):
- m_data[1] = int(nv_split[2])
- item = gps_model.cfg_by_name(name)
- key = item[1]
- val_type = item[2]
- cfg_type = self.item_to_type(item)
- size = 4 + cfg_type[0]
- frmat = cfg_type[1]
- flavor = cfg_type[2]
- if 'u' == flavor:
- val1 = int(val)
- elif 'i' == flavor:
- val1 = int(val)
- elif 'f' == flavor:
- val1 = float(val)
- kv_data = bytearray(size)
- kv_data[0] = (key) & 0xff
- kv_data[1] = (key >> 8) & 0xff
- kv_data[2] = (key >> 16) & 0xff
- kv_data[3] = (key >> 24) & 0xff
- struct.pack_into(frmat, kv_data, 4, val1)
- m_data.extend(kv_data)
- gps_model.gps_send(0x06, 0x8a, m_data)
- def send_log_findtime(self, args):
- """UBX-LOG-FINDTIME, search log for y,m,d,h,m,s"""
- m_data = bytearray(10)
- m_data[0] = 0
- m_data[1] = 0
-
-
- year = 2004
- month = 1
- day = 1
- hour = 0
- minute = 0
- second = 0
- if 0 < len(args):
- year = int(args[0])
- if 1 < len(args):
- month = int(args[1])
- if 2 < len(args):
- day = int(args[2])
- if 3 < len(args):
- hour = int(args[3])
- if 4 < len(args):
- minute = int(args[4])
- if 5 < len(args):
- second = int(args[5])
- m_data[2] = year % 256
- m_data[3] = int(year / 256) & 0xff
- m_data[4] = month
- m_data[5] = day
- m_data[6] = hour
- m_data[7] = minute
- m_data[8] = second
- m_data[9] = 0
- gps_model.gps_send(0x21, 0x0e, m_data)
- def send_log_retrieve(self, args):
- """UBX-LOG-RETRIEVE, gets logs from start,count"""
- m_data = bytearray(12)
-
- startNumber = 0
- entryCount = 256
- if 0 < len(args):
- startNumber = int(args[0])
- if 1 < len(args):
- entryCount = int(args[1])
- struct.pack_into('<LLB', m_data, 0, startNumber, entryCount, 0)
- gps_model.gps_send(0x21, 0x09, m_data)
- def send_log_string(self, args):
- """UBX-LOG-STRING, send string to log"""
- if 0 < len(args):
- string = args[0:256]
- else:
- string = "Hi"
- m_data = gps.polybytes(string)
- gps_model.gps_send(0x21, 0x04, m_data)
- def send_poll(self, m_data):
- """generic send pomonthll request"""
- gps_model.gps_send(m_data[0], m_data[1], m_data[2:])
- CFG_ANT = [0x06, 0x13]
- CFG_BATCH = [0x06, 0x93]
- CFG_DAT = [0x06, 0x06]
- CFG_GNSS = [0x06, 0x3e]
- CFG_GEOFENCE = [0x06, 0x69]
- CFG_INF_0 = [0x06, 0x02, 0]
- CFG_INF_1 = [0x06, 0x02, 1]
- CFG_LOGFILTER = [0x06, 0x47]
- CFG_ODO = [0x06, 0x1e]
- CFG_PRT = [0x06, 0x00]
- CFG_NAV5 = [0x06, 0x24]
- CFG_NAVX5 = [0x06, 0x23]
- CFG_NMEA = [0x06, 0x17]
- CFG_PM2 = [0x06, 0x3b]
- CFG_PMS = [0x06, 0x86]
- CFG_RATE = [0x06, 0x08]
- CFG_RXM = [0x06, 0x11]
- CFG_TMODE3 = [0x06, 0x71]
- CFG_TP5 = [0x06, 0x31]
- CFG_USB = [0x06, 0x1b]
- LOG_INFO = [0x21, 0x08]
- MON_COMMS = [0x0a, 0x36]
- MON_GNSS = [0x0a, 0x28]
- MON_HW = [0x0a, 0x09]
- MON_HW2 = [0x0a, 0x0b]
- MON_HW3 = [0x0a, 0x37]
- MON_IO = [0x0a, 0x02]
- MON_MSGPP = [0x0a, 0x06]
- MON_RF = [0x0a, 0x38]
- MON_RXBUF = [0x0a, 0x0a]
- MON_TXBUF = [0x0a, 0x08]
- MON_VER = [0x0a, 0x04]
- NAV_SVIN = [0x01, 0x3b]
- TIM_SVIN = [0x0d, 0x04]
- def get_config(self):
- """CONFIG. Get a bunch of config messages"""
- cmds = [ubx.MON_VER,
- ubx.CFG_ANT,
- ubx.CFG_DAT,
-
-
-
- ubx.CFG_GEOFENCE,
- ubx.CFG_GNSS,
-
- ubx.CFG_INF_0,
- ubx.CFG_INF_1,
-
- ubx.CFG_LOGFILTER,
- ubx.CFG_NAV5,
- ubx.CFG_NAVX5,
- ubx.CFG_NMEA,
- ubx.CFG_ODO,
- ubx.CFG_PRT,
- ubx.CFG_PM2,
- ubx.CFG_PMS,
- ubx.CFG_RATE,
- ubx.CFG_RXM,
- ubx.CFG_TP5,
- ubx.CFG_USB,
- ]
- if 20 < opts['protver']:
- cmds.append(ubx.CFG_TMODE3)
- if 22 < opts['protver']:
- cmds.append(ubx.CFG_BATCH)
-
- for cmd in cmds:
- gps_model.send_poll(cmd)
- def get_status(self):
- """STATUS. Get a bunch of status messages"""
- cmds = [ubx.MON_VER,
- ubx.LOG_INFO,
- ubx.MON_GNSS,
-
- ]
- if 27 <= opts['protver']:
- cmds.extend([ubx.MON_COMMS,
- ubx.MON_HW3,
- ])
- else:
-
- cmds.extend([ubx.MON_HW,
- ubx.MON_HW2,
- ubx.MON_IO,
- ubx.MON_MSGPP,
- ubx.MON_RF,
- ubx.MON_RXBUF,
- ubx.MON_TXBUF,
- ])
-
- cmds.extend([ubx.NAV_SVIN,
- ubx.TIM_SVIN,
- ])
-
- for cmd in cmds:
- gps_model.send_poll(cmd)
- able_commands = {
-
- "BATCH": {"command": send_able_cfg_batch,
- "help": "batching, using CFG-BATCH"},
-
- "BEIDOU": {"command": send_able_beidou,
- "help": "BeiDou B1. BEIDOU,5 for B1 and B2"},
-
- "BINARY": {"command": send_able_binary,
- "help": "basic binary messages"},
-
- "ECEF": {"command": send_able_ecef,
- "help": "ECEF"},
-
- "GPS": {"command": send_able_gps,
- "help": "GPS and QZSS L1C/A. GPS,2 for L1C/A and L2C"},
-
- "GALILEO": {"command": send_able_galileo,
- "help": "GALILEO E1. GALILEO,2 for E1 and E5b"},
-
- "GLONASS": {"command": send_able_glonass,
- "help": "GLONASS L1. GLONASS,2 for L1 and L2"},
-
- "LOG": {"command": send_able_logfilter,
- "help": "Data Logger"},
-
- "NED": {"command": send_able_ned,
- "help": "NAV-VELNED and NAV-RELPOSNED"},
-
- "NMEA": {"command": send_able_nmea,
- "help": "basic NMEA messages"},
-
- "RAWX": {"command": send_able_rawx,
- "help": "RAW/RAWX measurements"},
-
- "PPS": {"command": send_able_pps,
- "help": "PPS on TIMPULSE"},
-
- "SBAS": {"command": send_able_sbas,
- "help": "SBAS L1C"},
-
- "SFRBX": {"command": send_able_sfrbx,
- "help": "SFRB/SFRBX subframes"},
-
- "TP": {"command": send_able_tp,
- "help": "TP Time Pulse message"},
-
- "SURVEYIN": {"command": send_able_tmode2,
- "help": "Survey-in mode with TMODE2."
- " SURVEYIN2[,svinMinDur[,svinAccLimit]]\n"
- " "
- "Default svinMinDur 300 seconds\n"
- " "
- "Default svinAccLimit 50000",
- "args": 1},
-
- "SURVEYIN3": {"command": send_able_tmode3,
- "help": "Survey-in mode with TMODE3."
- " SURVEYIN3[,svinMinDur[,svinAccLimit]]\n"
- " "
- "Default svinMinDur 300 seconds\n"
- " "
- "Default svinAccLimit 500000",
- "args": 1},
-
- "RTCM3": {"command": send_able_rtcm3,
- "help": "required RTCM3 messages. USB port only"},
- }
- commands = {
-
- "COLDBOOT": {"command": send_cfg_rst,
- "help": "UBS-CFG-RST coldboot the GPS",
- "opt": 0xffff},
-
- "CONFIG": {"command": get_config,
- "help": "Get a lot of receiver config"},
-
- "HOTBOOT": {"command": send_cfg_rst,
- "help": "UBX-CFG-RST hotboot the GPS",
- "opt": 0},
-
- "MODEL": {"command": send_cfg_nav5_model,
- "help": "set UBX-CFG-NAV5 Dynamic Platform Model. "
- "MODEL,model",
- "args": 1},
-
- "RESET": {"command": send_cfg_cfg,
- "help": "UBX-CFG-CFG reset config to defaults",
- "opt": 1},
-
- "SAVE": {"command": send_cfg_cfg,
- "help": "UBX-CFG-CFG save current config",
- "opt": 0},
-
- "STATUS": {"command": get_status,
- "help": "Get a lot of receiver status"},
-
- "WARMBOOT": {"command": send_cfg_rst,
- "help": "UBX-CFG-RST warmboot the GPS",
- "opt": 1},
-
- "AID-ALM": {"command": send_poll, "opt": [0x0b, 0x30],
- "help": "poll UBX-AID-ALM Poll GPS Aiding Almanac Data"},
-
- "AID-AOP": {"command": send_poll, "opt": [0x0b, 0x33],
- "help": "poll UBX-AID-AOP Poll Poll AssistNow "
- "Autonomous data"},
-
- "AID-DATA": {"command": send_poll, "opt": [0x0b, 0x10],
- "help": "Poll all GPS Initial Aiding Data"},
-
- "AID-EPH": {"command": send_poll, "opt": [0x0b, 0x31],
- "help": "poll UBX-AID-EPH Poll GPS Aiding Ephemeris Data"},
-
- "AID-HUI": {"command": send_poll, "opt": [0x0b, 0x02],
- "help": "poll UBX-AID-HUI Poll GPS Health, UTC, Iono"},
-
- "AID-INI": {"command": send_poll, "opt": [0x0b, 0x01],
- "help": "poll UBX-AID-INI Poll Aiding position, time, "
- "frequency, clock drift"},
-
- "CFG-ANT": {"command": send_poll, "opt": [0x06, 0x13],
- "help": "poll UBX-CFG-ANT antenna config"},
-
-
- "CFG-BATCH": {"command": send_poll, "opt": [0x06, 0x93],
- "help": "poll UBX-CFG-BATCH data batching config",
- "minVer": 23},
-
- "CFG-DAT": {"command": send_poll, "opt": [0x06, 0x06],
- "help": "poll UBX-CFG-DAT Datum Setting"},
-
- "CFG-DGNSS": {"command": send_poll, "opt": [0x06, 0x70],
- "help": "poll UBX-CFG-DGNSS DGNSS configuration"},
-
- "CFG-DOSC": {"command": send_poll, "opt": [0x06, 0x61],
- "help": "poll UBX-CFG-DOSC Disciplined oscillator "
- "configuration"},
-
- "CFG-ESRC": {"command": send_poll, "opt": [0x06, 0x60],
- "help": "poll UBX-CFG-ESRC External synchronization "
- "source config"},
-
- "CFG-FXN": {"command": send_poll, "opt": [0x06, 0x0e],
- "help": "poll UBX-CFG-FXN FXN Configuration"},
-
- "CFG-GEOFENCE": {"command": send_poll, "opt": [0x06, 0x69],
- "help": "poll UBX-CFG-GEOFENCE Geofencing "
- "configuration"},
-
- "CFG-GNSS": {"command": send_poll, "opt": [0x06, 0x3e],
- "help": "poll UBX-CFG-GNSS GNSS config"},
-
- "CFG-HNR": {"command": send_poll, "opt": [0x06, 0x5c],
- "help": "poll UBX-CFG-HNR High Navigation Rate Settings"},
-
- "CFG-INF": {"command": poll_cfg_inf,
- "help": "poll UBX-CFG-INF Information Message "
- "Configuration"},
-
- "CFG-ITFM": {"command": send_poll, "opt": [0x06, 0x39],
- "help": "poll UBX-CFG-ITFM Jamming/Interference "
- "Monitor configuration"},
-
- "CFG-LOGFILTER": {"command": send_poll, "opt": [0x06, 0x47],
- "help": "poll UBX-CFG-LOGFILTER "
- " Data Logger Configuration",
- "minVer": 14},
-
- "CFG-MSG": {"command": send_poll_cfg_msg,
- "help": "poll/set UBX-CFG-MSG,class,ID[,rate]\n"
- " "
- "rate is optional and sets rate.",
- "args": 2},
-
- "CFG-NAV5": {"command": send_poll, "opt": [0x06, 0x24],
- "help": "poll UBX-CFG-NAV5 Nav Engines settings"},
-
- "CFG-NAVX5": {"command": send_poll, "opt": [0x06, 0x23],
- "help": "poll UBX-CFG-NAVX5 Nav Expert Settings"},
-
- "CFG-NMEA": {"command": send_poll, "opt": [0x06, 0x17],
- "help": "poll UBX-CFG-NMEA Extended NMEA protocol "
- "configuration V1"},
-
- "CFG-ODO": {"command": send_poll, "opt": [0x06, 0x1e],
- "help": "poll UBX-CFG-ODO Odometer, Low-speed COG "
- "Engine Settings"},
-
- "CFG-PM": {"command": send_poll, "opt": [0x06, 0x32],
- "help": "poll UBX-CFG-PM Power management settings"},
-
- "CFG-PM2": {"command": send_poll, "opt": [0x06, 0x3b],
- "help": "poll UBX-CFG-PM2 Extended power management "
- "settings"},
-
- "CFG-PMS": {"command": send_cfg_pms,
- "help": "poll/set UBX-CFG-PMS power management settings\n"
- " "
- "CFG-PMS[,powerSetupValue]",
- "args": 1},
-
- "CFG-PRT": {"command": send_cfg_prt,
- "help": "poll UBX-CFG-PRT I/O port settings"
- " "
- "CFG-PRT[,portID] defaults to current port",
- "args": 1},
-
-
- "CFG-RATE": {"command": send_cfg_rate,
- "help": "poll/set UBX-CFG-RATE measure/nav settings.\n"
- " "
- "CFG-RATE[,measRate,[navRate]]",
- "args": 2},
-
- "CFG-RINV": {"command": send_poll, "opt": [0x06, 0x34],
- "help": "poll UBX-CFG-RINV Contents of Remote Inventory"},
-
-
- "CFG-RXM": {"command": send_cfg_rxm,
- "help": "poll/set UBX-CFG-RXM RXM configuration.\n"
- " "
- "CFG-RXM[,lpMode]",
- "args": 1},
-
- "CFG-SBAS": {"command": send_poll, "opt": [0x06, 0x16],
- "help": "poll UBX-CFG-SBAS SBAS settings"},
-
- "CFG-SLAS": {"command": send_cfg_slas,
- "help": "poll/set UBX-CFG-SLAS SLAS configuration.\n"
- " "
- "CFG-SLAS[,mode]",
- "args": 1},
-
- "CFG-SMGR": {"command": send_poll, "opt": [0x06, 0x62],
- "help": "poll UBX-CFG-SMGR Synchronization manager "
- "configuration"},
-
- "CFG-TMODE": {"command": send_poll, "opt": [0x06, 0x1d],
- "help": "poll UBX-CFG-TMODE time mode settings",
- "maxVer": 6},
-
- "CFG-TMODE2": {"command": send_poll, "opt": [0x06, 0x3d],
- "help": "poll UBX-CFG-TMODE2 time mode 2 config",
- "minVer": 14},
-
- "CFG-TMODE3": {"command": send_poll, "opt": [0x06, 0x71],
- "help": "poll UBX-CFG-TMODE3 time mode 3 config",
- "minVer": 20},
-
- "CFG-TP": {"command": send_poll, "opt": [0x06, 0x07],
- "help": "poll UBX-CFG-TP TimePulse Parameters."},
-
- "CFG-TP5": {"command": send_cfg_tp5,
- "help": "poll UBX-TIM-TP5 time pulse decodes.\n"
- " "
- "CFG-TP5[,tpIdx] Default tpIdx is 0",
- "args": 1},
-
- "CFG-USB": {"command": send_poll, "opt": [0x06, 0x1b],
- "help": "poll UBX-CFG-USB USB config"},
-
- "ESF-INS": {"command": send_poll, "opt": [0x10, 0x15],
- "help": "poll UBX-ESF-INS Vehicle dynamics info"},
-
- "ESF-MEAS": {"command": send_poll, "opt": [0x10, 0x02],
- "help": "poll UBX-ESF-MEAS External sensor fusion "
- "measurements"},
-
- "ESF-STATUS": {"command": send_poll, "opt": [0x10, 0x10],
- "help": "poll UBX-ESF-STATUS External sensor fusion "
- "status"},
-
- "LOG-CREATE": {"command": send_poll,
- "opt": [0x21, 0x07, 0, 1, 0, 0, 0, 0, 0, 0],
- "help": "send UBX-LOG-CREATE",
- "minVer": 14},
-
- "LOG-ERASE": {"command": send_poll, "opt": [0x21, 0x03],
- "help": "send UBX-LOG-ERASE",
- "minVer": 14},
-
- "LOG-FINDTIME": {"command": send_log_findtime,
- "help": "search logs by time. "
- "LOG-FINDTIME,y,m,d,h,m,s\n",
- " "
- "all parameters optional"
- "args": 6},
-
- "LOG-INFO": {"command": send_poll, "opt": [0x21, 0x08],
- "help": "poll UBX-LOG-INFO",
- "minVer": 14},
-
- "LOG-RETRIEVE": {"command": send_log_retrieve,
- "help": "send UBX-LOG-RETRIEVE. "
- "LOG-RETRIEVE[,start,[count]]",
- "minVer": 14,
- "args": 2},
-
-
- "LOG-RETRIEVEBATCH": {"command": send_poll,
- "opt": [0x21, 0x10, 0, 1, 0, 0],
- "help": "send UBX-LOG-RETRIEVEBATCH",
- "minVer": 23},
-
- "LOG-STRING": {"command": send_log_string,
- "help": "send UBX-LOG-STRING. LOG-STRING[,string]",
- "minVer": 14,
- "args": 1},
-
- "MGA-DBD": {"command": send_poll, "opt": [0x13, 0x80],
- "help": "poll UBX-MGA-DBD Poll the Navigation Database"},
-
-
- "MON-BATCH": {"command": send_poll, "opt": [0x0a, 0x32],
- "help": "poll UBX-MON-BATCH Data batching "
- "buffer status",
- "maxVer": 23.99,
- "minVer": 23},
-
- "MON-COMMS": {"command": send_poll, "opt": [0x0a, 0x36],
- "help": "poll UBX-MON-COMMS Comm port information"},
-
- "MON-GNSS": {"command": send_poll, "opt": [0x0a, 0x28],
- "help": "poll UBX-MON-GNSS major GNSS selection"},
-
- "MON-HW": {"command": send_poll, "opt": [0x0a, 0x09],
- "help": "poll UBX-MON-HW Hardware Status"},
-
- "MON-HW2": {"command": send_poll, "opt": [0x0a, 0x0b],
- "help": "poll UBX-MON-HW2 Extended Hardware Status"},
-
- "MON-HW3": {"command": send_poll, "opt": [0x0a, 0x37],
- "help": "poll UBX-MON-HW3 HW I/O pin information"},
-
- "MON-IO": {"command": send_poll, "opt": [0x0a, 0x02],
- "help": "poll UBX-MON-IO I/O Subsystem Status"},
-
- "MON-MSGPP": {"command": send_poll, "opt": [0x0a, 0x06],
- "help": "poll UBX-MON-MSGPP Message Parese and "
- "Process Status"},
-
- "MON-PATCH": {"command": send_poll, "opt": [0x0a, 0x27],
- "help": "poll UBX-MON-PATCH Info on Installed Patches"},
-
- "MON-RF": {"command": send_poll, "opt": [0x0a, 0x38],
- "help": "poll UBX-MON-RF RF Information"},
-
- "MON-RXBUF": {"command": send_poll, "opt": [0x0a, 0x07],
- "help": "poll UBX-MON-RXBUF Receiver Buffer Status"},
-
- "MON-SMGR": {"command": send_poll, "opt": [0x0a, 0x2e],
- "help": "poll UBX-MON-SMGR Synchronization manager "
- "configuration"},
-
- "MON-TXBUF": {"command": send_poll, "opt": [0x0a, 0x08],
- "help": "poll UBX-MON-TXBUF Transmitter Buffer Status"},
-
- "MON-VER": {"command": send_poll, "opt": [0x0a, 0x04],
- "help": "poll UBX-MON-VER GPS version"},
-
- "NAV-AOPSTATUS": {"command": send_poll, "opt": [0x01, 0x60],
- "help": "poll UBX-NAV-AOPSTATUS AssistNow "
- "Autonomous Status"},
-
- "NAV-ATT": {"command": send_poll, "opt": [0x1, 0x5],
- "help": "poll UBX-NAV-ATT Attitude Solution"},
-
- "NAV-CLOCK": {"command": send_poll, "opt": [0x01, 0x22],
- "help": "poll UBX-NAV-CLOCK Clock Solution"},
-
- "NAV-DGPS": {"command": send_poll, "opt": [0x01, 0x31],
- "help": "poll UBX-NAV-DGPS DGPS Data Used for NAV"},
-
- "NAV-DOP": {"command": send_poll, "opt": [0x01, 0x04],
- "help": "poll UBX-NAV-DOP Dilution of Precision"},
-
- "NAV-GEOFENCE": {"command": send_poll, "opt": [0x01, 0x39],
- "help": "poll UBX-NAV-GEOFENCE Geofence status"},
-
- "NAV-HPPOSECEF": {"command": send_poll, "opt": [0x01, 0x13],
- "help": "poll UBX-NAV-HPPOSECEF ECEF position"},
-
- "NAV-HPPOSLLH": {"command": send_poll, "opt": [0x01, 0x14],
- "help": "poll UBX-NAV-HPPOSECEF LLH position"},
-
- "NAV-ODO": {"command": send_poll, "opt": [0x01, 0x09],
- "help": "poll UBX-NAV-ODO Odometer Solution"},
-
- "NAV-ORB": {"command": send_poll, "opt": [0x01, 0x34],
- "help": "poll UBX-NAV-ORB GNSS Orbit Database Info"},
-
- "NAV-POSECEF": {"command": send_poll, "opt": [0x01, 0x01],
- "help": "poll UBX-NAV-POSECEF ECEF position"},
-
- "NAV-POSLLH": {"command": send_poll, "opt": [0x01, 0x02],
- "help": "poll UBX-NAV-POSLLH LLH position"},
-
- "NAV-PVT": {"command": send_poll, "opt": [0x01, 0x07],
- "help": "poll UBX-NAV-PVT Navigation Position Velocity "
- "Time Solution"},
-
-
- "NAV-RELPOSNED": {"command": send_poll, "opt": [0x01, 0x3c],
- "help": "poll UBX-NAV-RELPOSNED Relative "
- "Positioning Info in NED frame"},
-
- "NAV-RESETODO": {"command": send_poll, "opt": [0x01, 0x10],
- "help": "UBX-NAV-RESETODO Reset odometer"},
-
- "NAV-SAT": {"command": send_poll, "opt": [0x01, 0x35],
- "help": "poll UBX-NAV-SAT Satellite Information"},
-
- "NAV-SBAS": {"command": send_poll, "opt": [0x01, 0x32],
- "help": "poll UBX-NAV-SBAS SBAS Status Data"},
-
- "NAV-SIG": {"command": send_poll, "opt": [0x01, 0x43],
- "help": "poll UBX-NAV-SIG Signal Information"},
-
- "NAV-SLAS": {"command": send_poll, "opt": [0x01, 0x42],
- "help": "poll UBX-NAV-SLAS QZSS L1S SLAS Status Data"},
-
- "NAV-SOL": {"command": send_poll, "opt": [0x01, 0x06],
- "help": "poll UBX-NAV-SOL Navigation Solution "
- "Information"},
-
- "NAV-STATUS": {"command": send_poll, "opt": [0x01, 0x03],
- "help": "poll UBX-NAV-STATUS Receiver Nav Status"},
-
- "NAV-SVIN": {"command": send_poll, "opt": [0x01, 0x3b],
- "help": "poll UBX-NAV-SVIN Survey-in data",
- "minver": 20},
-
- "NAV-SVINFO": {"command": send_poll, "opt": [0x01, 0x30],
- "help": "poll UBX-NAV-SVINFO Satellite Information"},
-
- "NAV-TIMEBDS": {"command": send_poll, "opt": [0x01, 0x24],
- "help": "poll UBX-NAV-TIMEBDS BDS Time Solution"},
-
- "NAV-TIMEGAL": {"command": send_poll, "opt": [0x01, 0x25],
- "help": "poll UBX-NAV-TIMEGAL Galileo Time Solution"},
-
- "NAV-TIMEGLO": {"command": send_poll, "opt": [0x01, 0x23],
- "help": "poll UBX-NAV-TIMEGLO GLO Time Solution"},
-
- "NAV-TIMEGPS": {"command": send_poll, "opt": [0x01, 0x20],
- "help": "poll UBX-NAV-TIMEGPS GPS Time Solution"},
-
- "NAV-TIMELS": {"command": send_poll, "opt": [0x01, 0x26],
- "help": "poll UBX-NAV-TIMELS Leap Second Info"},
-
- "NAV-TIMEUTC": {"command": send_poll, "opt": [0x01, 0x21],
- "help": "poll UBX-NAV-TIMEUTC UTC Time Solution"},
-
- "NAV-VELECEF": {"command": send_poll, "opt": [0x01, 0x11],
- "help": "poll UBX-NAV-VELECEF ECEF velocity"},
-
- "NAV-VELNED": {"command": send_poll, "opt": [0x01, 0x12],
- "help": "poll UBX-NAV-VELNED NED velocity"},
-
- "RXM-IMES": {"command": send_poll, "opt": [0x02, 0x61],
- "help": "poll UBX-RXM-IMES Indoor Messaging System "
- "Information"},
-
- "RXM-MEASX": {"command": send_poll, "opt": [0x02, 0x14],
- "help": "poll UBX-RXM-MEASX Satellite Measurements "
- " for RRLP"},
-
- "RXM-RAWX": {"command": send_poll, "opt": [0x02, 0x15],
- "help": "poll UBX-RXM-RAWX raw measurement data"},
-
- "SEC-UNIQID": {"command": send_poll, "opt": [0x27, 0x03],
- "help": "poll UBX-SEC-UNIQID Unique chip ID"},
-
- "TIM-SVIN": {"command": send_poll, "opt": [0x0d, 0x04],
- "help": "poll UBX-TIM-SVIN survey in data"},
-
- "TIM-TM2": {"command": send_poll, "opt": [0x0d, 0x03],
- "help": "poll UBX-TIM-TM2 time mark data"},
-
- "TIM-TP": {"command": send_poll, "opt": [0x0d, 0x01],
- "help": "poll UBX-TIM-TP time pulse timedata"},
-
- "TIM-VRFY": {"command": send_poll, "opt": [0x0d, 0x06],
- "help": "poll UBX-TIM-VRFY Sourced Time Verification"},
-
- "UPD-SOS": {"command": send_poll, "opt": [0x09, 0x14],
- "help": "poll UBX-UPD-SOS Backup File restore Status"},
-
- "UPD-SOS0": {"command": send_poll, "opt": [0x09, 0x14, 0, 0, 0, 0],
- "help": "UBX-UPD-SOS Create Backup File in Flash"},
-
- "UPD-SOS1": {"command": send_poll, "opt": [0x09, 0x14, 1, 0, 0, 0],
- "help": "UBX-UPD-SOS Create Clear File in Flash"},
- }
-
- class gps_io(object):
- """All the GPS I/O in one place"
- Three types of GPS I/O
- 1. read only from a file
- 2. read/write through a device
- 3. read only from a gpsd instance
- """
- out = b''
- ser = None
- input_is_device = False
- def __init__(self):
- """Initialize class"""
- Serial = serial
- Serial_v3 = Serial and Serial.VERSION.split('.')[0] >= '3'
-
- self.out = b''
-
- if opts['input_file_name'] is not None:
-
- try:
- mode = os.stat(opts['input_file_name']).st_mode
- except OSError:
- sys.stderr.write('%s: failed to open input file %s\n' %
- (PROG_NAME, opts['input_file_name']))
- sys.exit(1)
- if stat.S_ISCHR(mode):
-
- self.input_is_device = True
- if ((opts['disable'] or opts['enable'] or opts['poll'] or
- opts['oaf_name'])):
-
- if opts['read_only']:
- sys.stderr.write('%s: read-only mode, '
- 'can not send commands\n' % PROG_NAME)
- sys.exit(1)
- if self.input_is_device is False:
- sys.stderr.write('%s: input is plain file, '
- 'can not send commands\n' % PROG_NAME)
- sys.exit(1)
- if opts['target']['server'] is not None:
-
- try:
- self.ser = gps.gpscommon(host=opts['target']['server'],
- port=opts['target']['port'],
- verbose=0)
-
- self.ser.write = self.write_gpsd
-
- data_out = b'?WATCH={'
- if opts['target']['device'] is not None:
-
- data_out += (b'"device":"' +
- gps.polybytes(opts['target']['device']) +
- b'",')
- data_out += b'"enable":true,"raw":2}\r\n'
- if VERB_RAW <= opts['verbosity']:
- print("sent: ", data_out)
- self.ser.send(data_out)
- except socket.error as err:
- sys.stderr.write('%s: failed to connect to gpsd %s\n' %
- (PROG_NAME, err))
- sys.exit(1)
- elif self.input_is_device:
-
-
-
-
- write_timeout_arg = ('write_timeout'
- if Serial_v3 else 'writeTimeout')
- try:
- self.ser = Serial.Serial(
- baudrate=opts['input_speed'],
-
- bytesize=Serial.EIGHTBITS,
- parity=Serial.PARITY_NONE,
- port=opts['input_file_name'],
- stopbits=Serial.STOPBITS_ONE,
-
- timeout=0.05,
- **{write_timeout_arg: 0.5}
- )
- except AttributeError:
- sys.stderr.write('%s: failed to import pyserial\n' % PROG_NAME)
- sys.exit(2)
- except Serial.serialutil.SerialException:
-
- sys.stderr.write('%s: failed to open serial port "%s"\n'
- '%s: Your computer has the serial ports:\n' %
- (PROG_NAME, opts['input_file_name'],
- PROG_NAME))
-
- import serial.tools.list_ports as List_Ports
- ports = List_Ports.comports()
- for port in ports:
- sys.stderr.write(" %s: %s\n" %
- (port.device, port.description))
- sys.exit(1)
-
-
-
- self.ser.flushInput()
- else:
-
- try:
- self.ser = open(opts['input_file_name'], 'rb')
- except IOError:
- sys.stderr.write('%s: failed to open input %s\n' %
- (PROG_NAME, opts['input_file_name']))
- sys.exit(1)
- def read(self, read_opts):
- """Read from device, until timeout or expected message"""
-
- if gps_model.expect_statement_identifier:
-
- ret_code = 1
- else:
-
- ret_code = 0
- try:
- if read_opts['target']['server'] is not None:
-
- start = gps.monotonic()
- while read_opts['input_wait'] > (gps.monotonic() - start):
-
-
- if 0 < self.ser.waiting():
-
-
-
- new_out = self.ser.sock.recv(8192)
- if raw is not None:
-
- raw.write(new_out)
- self.out += new_out
- consumed = gps_model.decode_msg(self.out)
- self.out = self.out[consumed:]
- if ((gps_model.expect_statement_identifier and
- (gps_model.expect_statement_identifier ==
- gps_model.last_statement_identifier))):
-
- ret_code = 0
- if not read_opts['input_forced_wait']:
-
- break
- elif self.input_is_device:
-
- start = gps.monotonic()
- while read_opts['input_wait'] > (gps.monotonic() - start):
-
-
-
-
- if 0 < self.ser.inWaiting():
-
-
-
- new_out = self.ser.read(1024)
- if raw is not None:
-
- raw.write(new_out)
- self.out += new_out
- consumed = gps_model.decode_msg(self.out)
- self.out = self.out[consumed:]
- if ((gps_model.expect_statement_identifier and
- (gps_model.expect_statement_identifier ==
- gps_model.last_statement_identifier))):
-
- ret_code = 0
- if not read_opts['input_forced_wait']:
-
- break
- else:
-
- self.out += self.ser.read()
- if raw is not None:
-
- raw.write(self.out)
- while True:
- consumed = gps_model.decode_msg(self.out)
- self.out = self.out[consumed:]
- if 0 >= consumed:
- break
- except IOError:
-
-
- sys.stderr.write('%s: failed to read %s\n'
- '%s: Is gpsd already holding the port?\n'
- % (PROG_NAME, read_opts['input_file_name'],
- PROG_NAME))
- return 1
- if 0 < ret_code:
-
- sys.stderr.write('%s: waited %0.2f seconds for, '
- 'but did not get: %%%s%%\n'
- % (PROG_NAME, read_opts['input_wait'],
- gps_model.expect_statement_identifier))
- return ret_code
- def write_gpsd(self, data):
- """write data to gpsd daemon"""
-
-
-
- if 255 < len(data):
- sys.stderr.write('%s: trying to send %d bytes, max is 255\n'
- % (PROG_NAME, len(data)))
- return 1
- if opts['target']['device'] is not None:
-
- data_out = (b'?DEVICE={"path":"' +
- gps.polybytes(opts['target']['device']) + b'",')
- else:
- data_out = b'?DEVICE={'
-
- data_out += b'"hexdata":"' + binascii.hexlify(data) + b'"}\r\n'
- if VERB_RAW <= opts['verbosity']:
- print("sent: ", data_out)
- self.ser.send(data_out)
- return 0
- gps_model = ubx()
- def usage():
- """Output usage information, and exit"""
- print('usage: %s [OPTION] ... [[server[:port[:device]]]]\n\n'
- ' Options:\n'
- ' -? print help, increase -v for extra help\n'
- ' -c C send raw command C (cls,id...) to GPS\n'
- ' -d D disable D\n'
- ' -e E enable E\n'
- ' -f F open F as file/device\n'
- ' default: %s\n'
- ' -g I,l,p get config item I, optional layer l, '
- 'position p\n'
- ' -h print help, increase -v for extra help\n'
- ' -i P port ID # (interface) for -S\n'
- ' -P P Protocol version for sending commands\n'
- ' default: %s\n'
- ' -p P send a preset query P to GPS\n'
- ' -R R save raw data from GPS in file R\n'
- ' default: %s\n'
- ' -r open file/device read only\n'
- ' -S S set GPS speed to S\n'
- ' -s S set port speed to S\n'
- ' default: %s bps\n'
- ' -V print version\n'
- ' -v V Set verbosity level to V, 0 to 4\n'
- ' default: %d\n'
- ' -w W wait time W before exiting\n'
- ' default: %s seconds\n'
- ' -x I delete config item I from BBR and FLASH '
- 'layers\n'
- ' -z I,v,l set config item I to v, in optional layer l\n'
- '\n' %
- (PROG_NAME, opts['input_file_name'],
- opts['protver'], opts['raw_file'],
- opts['input_speed'], opts['input_wait'],
- opts['verbosity'])
- )
- if VERB_DECODE <= opts['verbosity']:
- print('D and E can be one of:')
- for item in sorted(gps_model.able_commands.keys()):
- print(" %-13s %s" %
- (item, gps_model.able_commands[item]["help"]))
- print('\nP can be one of:')
- for item in sorted(gps_model.commands.keys()):
- print(" %-13s %s" % (item, gps_model.commands[item]["help"]))
- print('\n')
- if VERB_DECODE < opts['verbosity']:
- print('\nConfiguration items for -g, -x and -z can be one of:')
- for item in sorted(gps_model.cfgs):
- print(" %s\n"
- " %s" % (item[0], item[5]))
- print('\n')
- print('Options can be placed in the UBXOPTS environment variable.\n'
- 'UBXOPTS is processed before the CLI options.')
- sys.exit(0)
- if 'UBXOPTS' in os.environ:
-
- opts['timestamp'] = 0
- opts['progopts'] = os.environ['UBXOPTS']
- options = opts['progopts'].split(' ') + sys.argv[1:]
- else:
- options = sys.argv[1:]
- try:
- (options, arguments) = getopt.getopt(options,
- "?c:d:e:f:g:hi:m:rP:p:"
- "s:w:v:R:S:tVx:z:")
- except getopt.GetoptError as err:
- sys.stderr.write("%s: %s\n"
- "Try '%s -h' for more information.\n" %
- (PROG_NAME, str(err), PROG_NAME))
- sys.exit(2)
- for (opt, val) in options:
- if opt == '-c':
- opts['command'] = val
- elif opt == '-d':
-
- opts['disable'].append(val.upper())
- elif opt == '-e':
- opts['enable'].append(val.upper())
- elif opt == '-f':
- opts['input_file_name'] = val
- elif opt == '-g':
- opts['get_item'].append(val.upper())
- elif opt in ('-h', '-?'):
- opts['help'] = True
- elif opt == '-i':
- valnum = gps_model.port_id_map.get(val.upper())
- opts['port'] = valnum if valnum is not None else int(val)
- elif opt == '-P':
-
- opts['protver'] = float(val)
- if 10 > opts['protver']:
- opts['protver'] = 10.0
-
- elif opt == '-p':
-
-
- opts['poll'].append(val.upper())
- elif opt in '-R':
-
- opts['raw_file'] = val
- elif opt == '-r':
- opts['read_only'] = True
- elif opt in '-S':
- opts['set_speed'] = int(val)
- if opts['set_speed'] not in gps_model.speeds:
- sys.stderr.write('%s: -S invalid speed %s\n' %
- (PROG_NAME, opts['set_speed']))
- sys.exit(1)
- elif opt == '-s':
- try:
- opts['input_speed'] = int(val)
- except ValueError:
- sys.stderr.write('%s: -s invalid speed %s\n' %
- (PROG_NAME, val))
- sys.exit(1)
- if opts['input_speed'] not in gps_model.speeds:
- sys.stderr.write('%s: -s invalid speed %s\n' %
- (PROG_NAME, opts['input_speed']))
- sys.exit(1)
- elif opt == '-t':
- opts['timestamp'] += 1
- elif opt == '-V':
-
- sys.stderr.write('%s: Version %s\n' % (PROG_NAME, gps_version))
- sys.exit(0)
- elif opt in '-v':
- opts['verbosity'] = int(val)
- elif opt == '-w':
- try:
- opts['input_wait'] = int(val)
- except ValueError:
- sys.stderr.write('%s: -w invalid time %s\n' % (PROG_NAME, val))
- sys.exit(1)
- elif opt == '-x':
- opts['del_item'].append(val)
- elif opt == '-z':
- opts['set_item'].append(val)
- if opts['help']:
- usage()
- if opts['input_file_name'] is None:
-
-
- opts['target']['server'] = "localhost"
- opts['target']['port'] = gps.GPSD_PORT
- opts['target']['device'] = None
- if arguments:
-
-
-
-
- if '[' == arguments[0][0]:
-
- match = re.match(r'''\[([:a-fA-F0-9]+)\](.*)''', arguments[0])
- opts['target']['server'] = match.group(1)
- parts = match.group(2).split(':')
- else:
-
- parts = arguments[0].split(':')
- if parts[0]:
- opts['target']['server'] = parts[0]
- if 1 < len(parts):
- if parts[1]:
- opts['target']['port'] = parts[1]
- if 2 < len(parts) and parts[2]:
- opts['target']['device'] = parts[2]
- elif arguments:
- sys.stderr.write('%s: Both input file and server specified\n' % PROG_NAME)
- sys.exit(1)
- if VERB_PROG <= opts['verbosity']:
-
- print('%s: Version %s\n' % (PROG_NAME, gps_version))
- print('Options:')
- for option in sorted(opts):
- print(" %s: %s" % (option, opts[option]))
- try:
-
- raw = None
- if opts['raw_file']:
- try:
- raw = open(opts['raw_file'], 'w')
- except IOError:
- sys.stderr.write('%s: failed to open raw file %s\n' %
- (PROG_NAME, opts['raw_file']))
- sys.exit(1)
-
- io_handle = gps_io()
- sys.stdout.flush()
- if opts['disable']:
- for disable in opts['disable']:
- if VERB_QUIET < opts['verbosity']:
- print('%s: disable %s\n' % (PROG_NAME, disable))
- args = disable.split(',')
- disable = args[0]
- if disable in gps_model.able_commands:
- command = gps_model.able_commands[disable]
- command["command"](gps, 0, disable[1:])
- else:
- sys.stderr.write('%s: disable %s not found\n' %
- (PROG_NAME, disable))
- sys.exit(1)
- if opts['enable']:
- for enable in opts['enable']:
- if VERB_QUIET < opts['verbosity']:
- print('%s: enable %s\n' % (PROG_NAME, enable))
- args = enable.split(',')
- enable = args[0]
- if enable in gps_model.able_commands:
- command = gps_model.able_commands[enable]
- command["command"](gps, 1, args[1:])
- else:
- sys.stderr.write('%s: enable %s not found\n' %
- (PROG_NAME, enable))
- sys.exit(1)
- if opts['poll']:
- for poll in opts['poll']:
- if VERB_QUIET < opts['verbosity']:
- print('%s: poll %s\n' % (PROG_NAME, poll))
- args = poll.split(',')
- poll = args[0]
- if poll in gps_model.commands:
- command = gps_model.commands[poll]
- if (('minVer' in command and
- opts['protver'] < command['minVer'])):
- print('%s: WARNING poll %s requires protVer >= %s '
- 'you have %s\n' %
- (PROG_NAME, poll, command['minVer'],
- opts['protver']))
- if (('maxVer' in command and
- opts['protver'] > command['maxVer'])):
- print('%s: WARNING poll %s requires protVer <= %s '
- 'you have %s\n' %
- (PROG_NAME, poll, command['maxVer'],
- opts['protver']))
- if 'opt' in command:
- command["command"](gps, command["opt"])
- elif 'args' in command:
-
- command["command"](gps, args[1:])
- else:
- command["command"](gps)
- else:
- sys.stderr.write('%s: poll %s not found\n' %
- (PROG_NAME, poll))
- sys.exit(1)
- elif opts['set_speed'] is not None:
- gps_model.send_set_speed(opts['set_speed'])
- elif opts['command'] is not None:
- cmd_list = opts['command'].split(',')
- try:
- cmd_data = [int(v, 16) for v in cmd_list]
- except ValueError:
- badarg = True
- else:
- data_or = reduce(operator.or_, cmd_data)
- badarg = data_or != data_or & 0xFF
- if badarg or len(cmd_list) < 2:
- sys.stderr.write('%s: Argument format (hex bytes) is'
- ' class,id[,payload...]\n' % PROG_NAME)
- sys.exit(1)
- payload = bytearray(cmd_data[2:])
- if VERB_QUIET < opts['verbosity']:
- print('%s: command %s\n' % (PROG_NAME, opts['command']))
- gps_model.gps_send(cmd_data[0], cmd_data[1], payload)
- elif opts['del_item']:
- keys = []
- for name in opts['del_item']:
- item = gps_model.cfg_by_name(name)
- if item:
- keys.append(item[1])
- else:
- sys.stderr.write('%s: ERROR: item %s unknown\n' %
- (PROG_NAME, opts['del_item']))
- sys.exit(1)
- gps_model.send_cfg_valdel(keys)
- elif opts['get_item']:
- keys = []
- layer = None
- position = 0
- end = None
- for item in opts['get_item']:
- parts = item.split(',')
- item = gps_model.cfg_by_name(parts[0])
- if item:
- keys.append(item[1])
- else:
- sys.stderr.write('%s: ERROR: item %s unknown\n' %
- (PROG_NAME, parts[0]))
- sys.exit(1)
- try:
- if 1 < len(parts):
- layer = int(parts[1])
- if 2 < len(parts):
- position = int(parts[2])
- if 3 < len(parts):
- end = int(parts[3])
- except ValueError:
- sys.stderr.write('%s: ERROR: -g %s, non numeric parameter\n' %
- (PROG_NAME, parts[0]))
- sys.exit(1)
- print("layer %s position %d end %s " % (layer, position, end))
- if end:
- for p in range(position, end, 64):
- gps_model.send_cfg_valget(keys, layer, p)
- else:
- gps_model.send_cfg_valget(keys, layer, position)
- elif opts['set_item']:
- nvs = []
- for nv in opts['set_item']:
- parts = nv.split(',')
- if 1 >= len(parts):
- sys.stderr.write('%s: ERROR: item %s missing value to set\n' %
- (PROG_NAME, parts[0]))
- sys.exit(1)
- item = gps_model.cfg_by_name(parts[0])
- if item:
- nvs.append(nv)
- else:
- sys.stderr.write('%s: ERROR: item %s unknown\n' %
- (PROG_NAME, parts[0]))
- sys.exit(1)
- gps_model.send_cfg_valset(nvs)
- exit_code = io_handle.read(opts)
- if ((VERB_RAW <= opts['verbosity']) and io_handle.out):
-
- print("Left over data:")
- print(io_handle.out)
- sys.stdout.flush()
- io_handle.ser.close()
- except KeyboardInterrupt:
- print('')
- exit_code = 1
- sys.exit(exit_code)
|