cfw.h 427 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. /**
  13. *@file cfw.h
  14. *@author RDA
  15. *@email
  16. *@version
  17. *@data
  18. */
  19. #ifndef _CFW_H_
  20. #define _CFW_H_
  21. #include <stdint.h>
  22. #include <stdbool.h>
  23. #include "cfw_cc.h"
  24. #include "cfw_config.h"
  25. #include "quec_proj_config.h"
  26. #include "cfw_sms.h"
  27. #include "cfw_utility.h"
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #ifdef CONFIG_SOC_6760
  32. typedef struct
  33. {
  34. char string[4];
  35. uint32_t seq;
  36. uint32_t time;
  37. uint16_t MsgId;
  38. uint16_t MsgLen;
  39. uint8_t payload[0];
  40. } CFW_NW_PSSTATSINDLTE_INFO;
  41. #endif
  42. typedef struct _PM_BATTERY_INFO
  43. {
  44. uint8_t nBatteryFlag;
  45. uint8_t nBatteryLifePercent;
  46. uint16_t nBatteryRealTimeVoltage;
  47. uint16_t nBatteryVoltage;
  48. uint16_t nBatteryCurrent;
  49. uint16_t nBatteryTemperature;
  50. uint8_t padding[2];
  51. uint32_t nBatteryLifeTime;
  52. uint32_t nBatteryFullLifeTime;
  53. } PM_BATTERY_INFO;
  54. typedef struct _CFW_EVENT
  55. {
  56. uint32_t nEventId;
  57. uint32_t nParam1;
  58. uint32_t nParam2;
  59. uint8_t nFlag;
  60. uint8_t nType;
  61. uint16_t nUTI;
  62. } CFW_EVENT;
  63. typedef struct _CFW_NV_PLMN
  64. {
  65. uint8_t plmn[9];
  66. } CFW_NV_PLMN;
  67. typedef uint32_t (*PFN_CFW_EV_PORC)(
  68. CFW_EVENT *pEvent,
  69. void *pUserData);
  70. typedef enum
  71. {
  72. CFW_IMS_SUSPEND_ALL = 0,
  73. CFW_IMS_SUSPEND_NORMAL,
  74. CFW_IMS_SUSPEND_EMREGENCY,
  75. CFW_IMS_SUSPEND_ENUM_FILL = 0x7fffffff
  76. } CFW_IMS_SUSPEND_TYPE;
  77. //#ifdef CFW_VOLTE_SUPPORT //quectel modify
  78. #define CFW_TELNUMBER_TYPE_INVALID 0 ///< No valid information in parameter <number>.
  79. #define CFW_TELNUMBER_TYPE_URI 1 ///< Number in <number> according to URI including the prefix specifying the URI type
  80. #define CFW_TELNUMBER_TYPE_NORMAL 2 ///< Number
  81. #define CFW_IMS_LOCATION_STRING_SZ 20
  82. typedef struct
  83. {
  84. uint8_t nLongiSize;
  85. uint8_t nLatiSize;
  86. uint8_t Longitude[CFW_IMS_LOCATION_STRING_SZ];
  87. uint8_t Latitude[CFW_IMS_LOCATION_STRING_SZ];
  88. } CFW_IMS_LOCINFO;
  89. //#endif //quectel modify
  90. typedef struct
  91. {
  92. uint8_t emerg_categ_present;
  93. uint8_t emerg_categ_value;
  94. } CFW_CcEmergCateg;
  95. typedef struct _OPER_DEFAULT_APN_INFO
  96. {
  97. const uint8_t OperatorId[6];
  98. const char *Defaultapn;
  99. } OPER_DEFAULT_APN_INFO;
  100. typedef struct _OPER_DEFAULT_APN_INFO_V2
  101. {
  102. uint8_t OperatorId[6];
  103. uint8_t Defaultapn[10];
  104. } OPER_DEFAULT_APN_INFO_V2;
  105. typedef struct
  106. {
  107. //UINT16 mode;//1:gsm/2:lte
  108. uint16_t band;
  109. uint16_t band_indicator;
  110. uint32_t channel; //dlarfcn
  111. uint16_t bw;
  112. int16_t pwr; //pcl
  113. uint16_t TxRxmode;
  114. uint16_t TxRx;
  115. uint16_t onoff;
  116. uint16_t reserved[3];
  117. } CFW_NW_NST_TX_PARA_CONFIG;
  118. #define BAL_PROC_DEFAULT 0
  119. #define BAL_PROC_COMPLETE 1
  120. #define BAL_PROC_CONTINUE 2
  121. #define BAL_PROC_NOT_CONSUME 4
  122. #define BAL_PROC_DONT_FREE_MEM 8 ///< Tell CFW don't free the EVETN struct.
  123. #define BAL_PROC_UNKOWN_ERR 0
  124. #define API_SIM_EF_ECC 41
  125. #define API_USIM_EF_ECC 107
  126. /*! \brief The CFW_EventName function get eventname by event id
  127. \param [in] id EVENT ID
  128. \return
  129. EventName
  130. */
  131. int32_t CFW_StartNstMode(CFW_SIM_ID nSimID);
  132. int32_t CFW_StopNstMode(CFW_SIM_ID nSimID);
  133. int32_t CFW_NstConfig(CFW_NW_NST_TX_PARA_CONFIG *nst_para_config, CFW_SIM_ID nSimID);
  134. int32_t CFW_NstGetrssi(void);
  135. const char *CFW_EventName(
  136. uint32_t id);
  137. /*! \brief The CFW_SetEventProc function installs an application-defined event procedure for CFW response events or indicator events.
  138. \param [in] nServiceType Identifier of CFW Service Type. This parameter can be one of the following value:
  139. \rst
  140. +--------------------+-----------------------------------------------------+
  141. | nServiceType | Description |
  142. +====================+=====================================================+
  143. | CFW_SRV_NW_EV_RSP | Indicate the response event of net work management |
  144. +--------------------+-----------------------------------------------------+
  145. | CFW_SRV_CC_EV_RSP | Indicate the response event of CC management events |
  146. +--------------------+-----------------------------------------------------+
  147. | CFW_SRV_SS_EV_RSP | Indicate the response event of SS management events |
  148. +--------------------+-----------------------------------------------------+
  149. | CFW_SRV_SIM_EV_RSP | Indicate the response event of SIM management |
  150. +--------------------+-----------------------------------------------------+
  151. | CFW_SRV_SMS_EV_RSP | Indicate the response event of SMS management |
  152. +--------------------+-----------------------------------------------------+
  153. | CFW_SRV_EV_IND | Indicate the indication event. |
  154. +--------------------+-----------------------------------------------------+
  155. \endrst
  156. \param [in] pUserData Pointer to user data. 用户的数据指针,该参数会传入注册的EventProc 函数去处理.
  157. \param [in] pfnEvProc Pointer to the function to be notified when the CFW notification event occur, see EventProc for more. 事件处理函数,当CFW事件到来时会调用该注册的函数.
  158. \return
  159. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  160. \rst
  161. +-------------------------+--------------------------------------------+
  162. | Error Code | Description |
  163. +=========================+============================================+
  164. | ERR_CFW_INVALID_SERVICE | The input parameter nServiceId is invalid. |
  165. +-------------------------+--------------------------------------------+
  166. \endrst
  167. */
  168. uint32_t CFW_SetEventProc(
  169. uint8_t nServiceId,
  170. void *pUserData,
  171. PFN_CFW_EV_PORC pfnRspEvProc);
  172. uint32_t CFW_BalInit(void);
  173. /*! \brief The CFW_SetEventProc function installs an application-defined event procedure for CFW response events or indicator events.
  174. \param [in] nServiceType Identifier of CFW Service Type. This parameter can be one of the following value:
  175. \rst
  176. +--------------------+-----------------------------------------------------+
  177. | nServiceType | Description |
  178. +====================+=====================================================+
  179. | CFW_SRV_NW_EV_RSP | Indicate the response event of net work management |
  180. +--------------------+-----------------------------------------------------+
  181. | CFW_SRV_CC_EV_RSP | Indicate the response event of CC management events |
  182. +--------------------+-----------------------------------------------------+
  183. | CFW_SRV_SS_EV_RSP | Indicate the response event of SS management events |
  184. +--------------------+-----------------------------------------------------+
  185. | CFW_SRV_SIM_EV_RSP | Indicate the response event of SIM management |
  186. +--------------------+-----------------------------------------------------+
  187. | CFW_SRV_SMS_EV_RSP | Indicate the response event of SMS management |
  188. +--------------------+-----------------------------------------------------+
  189. | CFW_SRV_EV_IND | Indicate the indication event. |
  190. +--------------------+-----------------------------------------------------+
  191. \endrst
  192. \param [in] pUserData Pointer to user data. 用户的数据指针,该参数会传入注册的EventProc 函数去处理.
  193. \param [in] pfnEvProc Pointer to the function to be notified when the CFW notification event occur, see EventProc for more. 事件处理函数,当CFW事件到来时会调用该注册的函数.
  194. \return
  195. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  196. \rst
  197. +-------------------------+--------------------------------------------+
  198. | Error Code | Description |
  199. +=========================+============================================+
  200. | ERR_CFW_INVALID_SERVICE | The input parameter nServiceId is invalid. |
  201. +-------------------------+--------------------------------------------+
  202. \endrst
  203. */
  204. uint32_t CFW_BalSetEventPorc(
  205. void *pUserData,
  206. PFN_CFW_EV_PORC pfnProc);
  207. /*! \brief The CFW_IsFreeUTI function checks the specific UTI is free or not.
  208. \param [in] nUTI Specify the UTI to check.
  209. \param [in] nServiceId Identifier of CFW module. This parameter can be one of the following value:
  210. \rst
  211. +-------------------+---------------------------------------------------+
  212. | nServiceId | Description |
  213. +===================+===================================================+
  214. | CFW_NW_SRV_ID | Indicate the Network management. |
  215. +-------------------+---------------------------------------------------+
  216. | CFW_SIM_SRV_ID | Indicate the SIM management. |
  217. +-------------------+---------------------------------------------------+
  218. | CFW_CM_SRV_ID | Indicate the Call related SS and Call management. |
  219. +-------------------+---------------------------------------------------+
  220. | CFW_SS_SRV_ID | Indicate the Call Indented SS management. |
  221. +-------------------+---------------------------------------------------+
  222. | CFW_SMS_MO_SRV_ID | Indicate the SMS management. |
  223. +-------------------+---------------------------------------------------+
  224. | CFW_SMS_MT_SRV_ID | Indicate the SIM management. |
  225. +-------------------+---------------------------------------------------+
  226. \endrst
  227. \return
  228. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  229. \rst
  230. +----------------------------+-------------------------------------------------------------------+
  231. | Error Code | Description |
  232. +============================+===================================================================+
  233. | ERR_CFW_NOT_EXIST_FREE_UTI | The specified input nUTI is no a available free UTI in the system |
  234. +----------------------------+-------------------------------------------------------------------+
  235. \endrst
  236. */
  237. uint32_t CFW_IsFreeUTI(
  238. uint16_t nUTI,
  239. uint32_t nServiceId);
  240. /*! \brief The CFW_GetFreeUTI function retrieves the free UTI.
  241. \param [in] pUTI Pointer to uint8_t type to retrieve the free UTI.
  242. \param [in] nServiceId Identifier of CFW module. This parameter can be one of the following value:
  243. \rst
  244. +-------------------+---------------------------------------------------+
  245. | nServiceId | Description |
  246. +===================+===================================================+
  247. | CFW_NW_SRV_ID | Indicate the Network management. |
  248. +-------------------+---------------------------------------------------+
  249. | CFW_SIM_SRV_ID | Indicate the SIM management. |
  250. +-------------------+---------------------------------------------------+
  251. | CFW_CM_SRV_ID | Indicate the Call related SS and Call management. |
  252. +-------------------+---------------------------------------------------+
  253. | CFW_SS_SRV_ID | Indicate the Call Indented SS management. |
  254. +-------------------+---------------------------------------------------+
  255. | CFW_SMS_MO_SRV_ID | Indicate the SMS management. |
  256. +-------------------+---------------------------------------------------+
  257. | CFW_SMS_MT_SRV_ID | Indicate the SIM management. |
  258. +-------------------+---------------------------------------------------+
  259. \endrst
  260. \return
  261. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  262. \rst
  263. +----------------------------+------------------------------------------+
  264. | Error Code | Description |
  265. +============================+==========================================+
  266. | ERR_CFW_INVALID_PARAMETER | The input parameter is invalid. |
  267. +----------------------------+------------------------------------------+
  268. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system. |
  269. +----------------------------+------------------------------------------+
  270. \endrst
  271. */
  272. uint32_t CFW_GetFreeUTI(
  273. uint32_t nServiceId,
  274. uint8_t *pUTI);
  275. bool CFW_BlockEvent(
  276. uint32_t event);
  277. bool CFW_UnBlockEvent(
  278. uint32_t event);
  279. /*! \brief The CFW_IsServiceAvailable function detects wether the service is available.
  280. \param [in] nServiceId Identifier of CFW module. This parameter can be one of the following value:
  281. \rst
  282. +-------------------+---------------------------------------------------+
  283. | nServiceId | Description |
  284. +===================+===================================================+
  285. | CFW_NW_SRV_ID | Indicate the Network management. |
  286. +-------------------+---------------------------------------------------+
  287. | CFW_SIM_SRV_ID | Indicate the SIM management. |
  288. +-------------------+---------------------------------------------------+
  289. | CFW_CM_SRV_ID | Indicate the Call related SS and Call management. |
  290. +-------------------+---------------------------------------------------+
  291. | CFW_SS_SRV_ID | Indicate the Call Indented SS management. |
  292. +-------------------+---------------------------------------------------+
  293. | CFW_SMS_MO_SRV_ID | Indicate the SMS management. |
  294. +-------------------+---------------------------------------------------+
  295. | CFW_SMS_MT_SRV_ID | Indicate the SIM management. |
  296. +-------------------+---------------------------------------------------+
  297. \endrst
  298. \param [out] pAvailable Pointer to uint8_t type to detect the specified service is available. This parameter can be one of the following value returned:
  299. \rst
  300. +-----------------+-------------+
  301. | nServiceId | Description |
  302. +=================+=============+
  303. | CFW_NW_PS_START | |
  304. +-----------------+-------------+
  305. | CFW_SIM_INIT_OK | SAT |
  306. +-----------------+-------------+
  307. | CFW_SIM_INIT_OK | |
  308. +-----------------+-------------+
  309. \endrst
  310. \return
  311. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  312. \rst
  313. +---------------------------+-------------------------------------------+
  314. | Error Code | Description |
  315. +===========================+===========================================+
  316. | ERR_CFW_INVALID_PARAMETER | The input parameter pAvailable is NULL |
  317. +---------------------------+-------------------------------------------+
  318. | ERR_CFW_INVALID_SERVICE | The input parameter nServiceId is invalid |
  319. +---------------------------+-------------------------------------------+
  320. \endrst
  321. */
  322. uint32_t CFW_IsServiceAvailable(
  323. uint32_t nServiceId,
  324. uint8_t *pAvailable);
  325. /*! \brief The CFW_SendReqEvent function sends the request message to CFW layer.
  326. \param [in] nEventId Specify the identifier of the request event to CFW layer.
  327. \param [in] nParam1 The request event associated parameter.
  328. \param [in] nParam2 The request event associated parameter.
  329. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  330. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  331. module. This parameter should be less than 255 for all upper layer application.
  332. \return
  333. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  334. \rst
  335. +-------------------------+--------------------------------------------+
  336. | Error Code | Description |
  337. +=========================+============================================+
  338. | ERR_CFW_INVALID_SERVICE | The input parameter nServiceId is invalid. |
  339. +-------------------------+--------------------------------------------+
  340. \endrst
  341. */
  342. uint32_t CFW_SendReqEvent(
  343. uint32_t nEventId,
  344. uint32_t nParam1,
  345. uint32_t nParam2,
  346. uint8_t nUTI);
  347. #define CFW_CONTROL_CMD_POWER_ON 0
  348. #define CFW_CONTROL_CMD_POWER_OFF 1
  349. #define CFW_CONTROL_CMD_RESTART 2
  350. #define CFW_CONTROL_CMD_RESET 3
  351. #define CFW_CONTROL_CMD_RF_OFF 4
  352. typedef struct _CFW_SPN_INFO
  353. {
  354. uint8_t nSPNameLen;
  355. uint8_t nSPNDisplayFlag;
  356. uint8_t nSpnName[17];
  357. } CFW_SPN_INFO;
  358. void CFW_nvmWriteStatic(CFW_SIM_ID nSimID);
  359. uint32_t CFW_ShellControl(
  360. uint8_t nCommand);
  361. uint32_t CFW_ShellControl_V2(uint16_t nUTI, uint8_t nCommand);
  362. uint32_t CFW_ISRNotifySimStatus(uint8_t iSlotStatus, CFW_SIM_ID nSimID);
  363. //
  364. // Configuration(CFG) Management
  365. //
  366. // General Configuration
  367. /*! \brief The CFW_CfgSetPhoneFunctionality function sets the level of functionality.
  368. \param [in] nLevel Specify the functionality level. This parameter can be one of the following value:
  369. \rst
  370. +--------+--------------------------------------------------------+
  371. | nLevel | Description |
  372. +========+========================================================+
  373. | | Minimum functionality (SLEEP mode).The GSM module will |
  374. | 0 | disconnects any call in progress.The SLEEP mode starts |
  375. | | after remaining network activities are terminated. |
  376. +--------+--------------------------------------------------------+
  377. | 1 | Full functionality. |
  378. +--------+--------------------------------------------------------+
  379. | 2 | Disable transmit RF circuits only. |
  380. +--------+--------------------------------------------------------+
  381. | 3 | Disable receive RF circuits only. |
  382. +--------+--------------------------------------------------------+
  383. | 4 | Disable both transmit and receive RF circuits |
  384. +--------+--------------------------------------------------------+
  385. | | Reserved for other manufacturer-defined states between |
  386. | 5-127 | minimum and full functionality. |
  387. +--------+--------------------------------------------------------+
  388. \endrst
  389. \param [in] nRst Specify the functionality level. This parameter can be one of the following value:
  390. \rst
  391. +------+----------------------------------------------------------------+
  392. | nRst | Description |
  393. +======+================================================================+
  394. | | The <rst> parameter can only be used if +CFUN=1.Due to the |
  395. | 0 | command syntax, you need to enter <fun>, followed by <rst>, |
  396. | | where <fun> is only a placeholder and has no effect. |
  397. +------+----------------------------------------------------------------+
  398. | | ME resets and restarts to full functionality. After reset and |
  399. | | restart, PIN 1 authentication is necessary. Therefore, you are |
  400. | 1 | required to use AT+CPIN again.If autobauding is enabled it is |
  401. | | recommended to wait 3 to 5 seconds before entering the first |
  402. | | AT command. |
  403. +------+----------------------------------------------------------------+
  404. \endrst
  405. \return
  406. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  407. \rst
  408. +---------------------------+---------------------------------+
  409. | Error Code | Description |
  410. +===========================+=================================+
  411. | ERR_CFW_INVALID_PARAMETER | The input parameter is invalid. |
  412. +---------------------------+---------------------------------+
  413. | ERR_CME_SIM_PIN_REQUIRED | SIM Request PIN |
  414. +---------------------------+---------------------------------+
  415. \endrst
  416. */
  417. uint32_t CFW_CfgSetPhoneFunctionality(
  418. uint8_t nLevel,
  419. uint8_t nRst);
  420. /*! \brief The CFW_CfgGetPhoneFunctionality function gets the level of functionality.
  421. \param [out] pLevel Specify the functionality level. This parameter can be one of the following value:
  422. \rst
  423. +--------+--------------------------------------------------------+
  424. | nLevel | Description |
  425. +========+========================================================+
  426. | | Minimum functionality (SLEEP mode).The GSM module will |
  427. | 0 | disconnects any call in progress.The SLEEP mode starts |
  428. | | after remaining network activities are terminated. |
  429. +--------+--------------------------------------------------------+
  430. | 1 | Full functionality. |
  431. +--------+--------------------------------------------------------+
  432. | 2 | Disable transmit RF circuits only. |
  433. +--------+--------------------------------------------------------+
  434. | 3 | Disable receive RF circuits only. |
  435. +--------+--------------------------------------------------------+
  436. | 4 | Disable both transmit and receive RF circuits |
  437. +--------+--------------------------------------------------------+
  438. | | Reserved for other manufacturer-defined states between |
  439. | 5-127 | minimum and full functionality. |
  440. +--------+--------------------------------------------------------+
  441. \endrst
  442. \return
  443. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  444. \rst
  445. +---------------------------+---------------------------------+
  446. | Error Code | Description |
  447. +===========================+=================================+
  448. | ERR_CFW_INVALID_PARAMETER | The input parameter is invalid. |
  449. +---------------------------+---------------------------------+
  450. \endrst
  451. */
  452. uint32_t CFW_CfgGetPhoneFunctionality(
  453. uint8_t *pLevel);
  454. /*! \brief The CFW_CfgStoreUserProfile function stores current configuration to user defined profile.
  455. \return
  456. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  457. \rst
  458. +---------------------------+---------------------------------+
  459. | Error Code | Description |
  460. +===========================+=================================+
  461. | ERR_CFW_INVALID_PARAMETER | The input parameter is invalid. |
  462. +---------------------------+---------------------------------+
  463. \endrst
  464. */
  465. uint32_t CFW_CfgStoreUserProfile(void);
  466. /*! \brief The CFW_CfgGetUserProfile function get current stores configuration from user defined profile.
  467. \return
  468. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  469. \rst
  470. +---------------------------+---------------------------------+
  471. | Error Code | Description |
  472. +===========================+=================================+
  473. | ERR_CFW_INVALID_PARAMETER | The input parameter is invalid. |
  474. +---------------------------+---------------------------------+
  475. \endrst
  476. */
  477. uint32_t CFW_CfgGetUserProfile(void);
  478. /*! \brief The CFW_CfgRestoreFactoryProfile function restores current configuration to user defined profile.
  479. \return
  480. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  481. \rst
  482. +---------------------------+---------------------------------+
  483. | Error Code | Description |
  484. +===========================+=================================+
  485. | ERR_CFW_INVALID_PARAMETER | The input parameter is invalid. |
  486. +---------------------------+---------------------------------+
  487. \endrst
  488. */
  489. uint32_t CFW_CfgRestoreFactoryProfile(void);
  490. #define CFW_CHSET_UCS2 0
  491. #define CFW_CHSET_GSM 1
  492. /*! \brief function informs TA which character set <chset> is used by the TE. TA is then able to convert character strings correctly between TE and ME
  493. character sets.
  494. \param [out] chset Specify the character set, this parameter can be one of the following value:
  495. \rst
  496. +----------------+-------+-------------------------------------------------------------------------------------------------+
  497. | chset | value | Description |
  498. +================+=======+=================================================================================================+
  499. | CFW_CHSET_UCS2 | 0 | 16-bit universal multiple-octet coded character set (ISO/IEC10646 [32]); |
  500. | | | UCS2 character strings are converted to hexadecimal numbers from 0000 to FFFF; |
  501. | | | e.g."004100620063" equals three 16-bit characters with decimal values 65, 98 and 99, $(AT R97)$ |
  502. +----------------+-------+-------------------------------------------------------------------------------------------------+
  503. | CFW_CHSET_GSM | 1 | GSM default alphabet (GSM 03.38 subclause 6.2.1); |
  504. | | | Note:This setting may cause software flow control problems due to values of XON/XOFF characters |
  505. +----------------+-------+-------------------------------------------------------------------------------------------------+
  506. \endrst
  507. \return \a ERR_SUCCESS on success, or error code
  508. - \a ERR_CFW_INVALID_PARAMETER The input parameter(nFac) is invalid.
  509. */
  510. uint32_t CFW_CfgGetCharacterSet(
  511. uint8_t *chset);
  512. /*! \brief function informs TA which character set <chset> is used by the TE. TA is then able to convert character strings correctly between TE and ME
  513. character sets.
  514. \param [in] chset Specify the character set, this parameter can be one of the following value:
  515. \rst
  516. +----------------+-------+-------------------------------------------------------------------------------------------------+
  517. | chset | value | Description |
  518. +================+=======+=================================================================================================+
  519. | CFW_CHSET_UCS2 | 0 | 16-bit universal multiple-octet coded character set (ISO/IEC10646 [32]); |
  520. | | | UCS2 character strings are converted to hexadecimal numbers from 0000 to FFFF; |
  521. | | | e.g."004100620063" equals three 16-bit characters with decimal values 65, 98 and 99, $(AT R97)$ |
  522. +----------------+-------+-------------------------------------------------------------------------------------------------+
  523. | CFW_CHSET_GSM | 1 | GSM default alphabet (GSM 03.38 subclause 6.2.1); |
  524. | | | Note:This setting may cause software flow control problems due to values of XON/XOFF characters |
  525. +----------------+-------+-------------------------------------------------------------------------------------------------+
  526. \endrst
  527. \return \a ERR_SUCCESS on success, or error code
  528. - \a ERR_CFW_INVALID_PARAMETER The input parameter(nFac) is invalid.
  529. */
  530. uint32_t CFW_CfgSetCharacterSet(
  531. uint8_t chset);
  532. typedef struct _CFW_IND_EVENT_INFO
  533. {
  534. uint32_t bc : 3;
  535. uint32_t sq : 3;
  536. uint32_t nw_srv : 1;
  537. uint32_t sms_receive : 1;
  538. uint32_t call : 1;
  539. uint32_t roam : 1;
  540. uint32_t sms_full : 1;
  541. uint32_t sounder : 1;
  542. uint32_t bit_err : 8;
  543. } CFW_IND_EVENT_INFO;
  544. typedef enum
  545. {
  546. /// Chip product ID
  547. CFW_SYS_CHIP_PROD_ID,
  548. /// Chip bond ID
  549. CFW_SYS_CHIP_BOND_ID,
  550. /// Chip metal ID
  551. CFW_SYS_CHIP_METAL_ID,
  552. /// Chip ID whole
  553. CFW_SYS_CHIP_ID_WHOLE,
  554. CFW_SYS_CHIP_ID_ENUM_FILL = 0x7fffffff
  555. } CFW_SYS_CHIP_ID_T;
  556. /*! \brief function sets the specified indicator event to report.
  557. \param [in] ind Identifier of CFW Service. This parameter can be any combination of the following value:
  558. \rst
  559. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  560. | ind | Corresponding event | Description |
  561. +===============================+===================================+==============================================================================================+
  562. | CFW_CFG_IND_BC_EVENT | EV_PM_BC_IND | battery charge level report, see PM_GetBatteryInfo for more. |
  563. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  564. | CFW_CFG_IND_SQ_EVENT | EV_CFW_NW_SIGNAL_QUALITY_IND | signal quality report |
  565. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  566. | CFW_CFG_IND_NW_EVENT | EV_CFW_NW_REG_STATUS_IND,type = 0 | Network service availability |
  567. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  568. | CFW_CFG_IND_SOUNDER_EVENT | EV_CFW_CC_CALL_INFO_IND | sounder activity (0-1) |
  569. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  570. | CFW_CFG_IND_SMS_RECEIVE_EVENT | EV_CFW_NEW_SMS_IND , type=0 | new message received. |
  571. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  572. | CFW_CFG_IND_CALL_EVENT | EV_CFW_CC_CALL_INFO_IND | call in progress |
  573. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  574. | CFW_CFG_IND_VOX_EVENT | TODO... | transmit activated by voice activity |
  575. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  576. | CFW_CFG_IND_ROAM_EVENT | EV_CFW_NW_REG_STATUS_IND,type = 1 | roaming indicator |
  577. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  578. | CFW_CFG_IND_SMS_FULL_EVENT | EV_CFW_SMS_INFO_IND | a short message memory storage in the MT has become full, or memory locations are available. |
  579. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  580. | CFW_CFG_IND_BIT_ERR_EVENT | EV_CFW_NW_SIGNAL_QUALITY_IND | signal bit error report |
  581. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  582. \endrst
  583. \return \a ERR_SUCCESS on success, or error code
  584. - \a ERR_CFW_INVALID_PARAMETER The input parameter(nFac) is invalid.
  585. */
  586. uint32_t CFW_CfgSetIndicatorEvent(
  587. uint16_t ind,
  588. CFW_SIM_ID nSimID);
  589. /*! \brief function retrieves the specified indicator event.
  590. \param [out] ind Identifier of CFW Service. This parameter can be any combination of the following value:
  591. \rst
  592. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  593. | ind | Corresponding event | Description |
  594. +===============================+===================================+==============================================================================================+
  595. | CFW_CFG_IND_BC_EVENT | EV_PM_BC_IND | battery charge level report, see PM_GetBatteryInfo for more. |
  596. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  597. | CFW_CFG_IND_SQ_EVENT | EV_CFW_NW_SIGNAL_QUALITY_IND | signal quality report |
  598. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  599. | CFW_CFG_IND_NW_EVENT | EV_CFW_NW_REG_STATUS_IND,type = 0 | Network service availability |
  600. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  601. | CFW_CFG_IND_SOUNDER_EVENT | EV_CFW_CC_CALL_INFO_IND | sounder activity (0-1) |
  602. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  603. | CFW_CFG_IND_SMS_RECEIVE_EVENT | EV_CFW_NEW_SMS_IND , type=0 | new message received. |
  604. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  605. | CFW_CFG_IND_CALL_EVENT | EV_CFW_CC_CALL_INFO_IND | call in progress |
  606. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  607. | CFW_CFG_IND_VOX_EVENT | TODO... | transmit activated by voice activity |
  608. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  609. | CFW_CFG_IND_ROAM_EVENT | EV_CFW_NW_REG_STATUS_IND,type = 1 | roaming indicator |
  610. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  611. | CFW_CFG_IND_SMS_FULL_EVENT | EV_CFW_SMS_INFO_IND | a short message memory storage in the MT has become full, or memory locations are available. |
  612. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  613. | CFW_CFG_IND_BIT_ERR_EVENT | EV_CFW_NW_SIGNAL_QUALITY_IND | signal bit error report |
  614. +-------------------------------+-----------------------------------+----------------------------------------------------------------------------------------------+
  615. \endrst
  616. \return \a ERR_SUCCESS on success, or error code
  617. - \a ERR_CFW_INVALID_PARAMETER The input parameter(nFac) is invalid.
  618. */
  619. uint32_t CFW_CfgGetIndicatorEvent(
  620. uint16_t *ind,
  621. CFW_SIM_ID nSimID);
  622. /*! \brief function sets the indication related information.
  623. \param [in] pIndInfo Pointer to CFW_IND_EVENT_INFO structure to retrieve the indicator information.
  624. \param [in] nSimID SIM ID
  625. \return \a ERR_SUCCESS on success, or error code
  626. - \a ERR_CFW_INVALID_PARAMETER The input parameter(nFac) is invalid.
  627. */
  628. uint32_t CFW_CfgSetIndicatorEventInfo(
  629. CFW_IND_EVENT_INFO *pIndInfo,
  630. CFW_SIM_ID nSimID);
  631. /*! \brief function retrieves the indication set by CFW_CfgSetIndicatorEvent
  632. \param [out] pIndInfo Pointer to CFW_IND_EVENT_INFO structure to retrieve the indicator information.
  633. \param [in] nSimID SIM ID
  634. \return \a ERR_SUCCESS on success, or error code
  635. - \a ERR_CFW_INVALID_SERVICE The input parameter nServiceId is invalid.
  636. */
  637. uint32_t CFW_CfgGetIndicatorEventInfo(
  638. CFW_IND_EVENT_INFO *pIndInfo,
  639. CFW_SIM_ID nSimID);
  640. uint32_t CFW_SetQualReport(
  641. bool bStart,
  642. CFW_SIM_ID nSimID);
  643. uint32_t CFW_CfgSetFirstPowerOnFlag(
  644. bool bFPO);
  645. uint32_t CFW_CfgCheckFirstPowerOnFlag(
  646. bool *pbFPO);
  647. /*! \brief function retrieves the presentation of the event reporting.
  648. \param [out] pMer Pointer to UINT16 to contain the presentation of the event reporting. This parameter can be one of the following value:bit0-bit1 : use CFW_CFG_CMER_MODE(mer) to get mode.
  649. - \a bit0-bit1 : use CFW_CFG_CMER_MODE(mer) to get mode.
  650. \rst
  651. +------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  652. | mode value | Description |
  653. +============+===============================================================================================================================================================+
  654. | 0 | buffer unsolicited result codes in the TA; if TA result code buffer is full, codes can be buffered in some other place or the oldest ones can be discarded |
  655. +------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  656. | 1 | discard unsolicited result codes when TA TE link is reserved (e.g. in on line data mode); otherwise forward them directly to the TE |
  657. +------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  658. | 2 | buffer unsolicited result codes in the TA when TA TE link is reserved (e.g. in on line data mode) and flush them to the TE after reservation; |
  659. | | otherwise forward them directly to the TE |
  660. +------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  661. | 3 | forward unsolicited result codes directly to the TE; TA TE link specific inband technique used to embed result codes and data when TA is in on line data mode |
  662. +------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  663. \endrst
  664. - \a bit 2-bit3: use CFW_CFG_CMER_KEYP(mer) to get keyp.
  665. \rst
  666. +------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  667. | Keyp value | Description |
  668. +============+==============================================================================================================================================================+
  669. | 0 | no keypad event reporting |
  670. +------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  671. | 1 | keypad event reporting using result code +CKEV: <key>,<press>. <key> indicates the key (refer IRA values defined in table in subclause "Keypad control |
  672. | | +CKPD") and <press> if the key is pressed or released (1 for pressing and 0 for releasing). Only those key pressings, which are not caused by +CKPD shall be |
  673. | | indicated by the TA to the TE. |
  674. +------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  675. | 2 | keypad event reporting using result code +CKEV: <key>,<press>. All key pressings shall be directed from TA to TE. |
  676. +------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  677. \endrst
  678. - \a bit4-bit5:use CFW_CFG_CMER_DISP(mer) to get Disp.
  679. \rst
  680. +------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  681. | Disp value | Description |
  682. +============+============================================================================================================================================================+
  683. | 0 | no keypad event reporting |
  684. +------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  685. | 1 | display event reporting using result code +CDEV: <elem>,<text>. <elem> indicates the element order number (as specified for +CDIS) and <text> is the new |
  686. | | value of text element. Only those display events, which are not caused by +CDIS shall be indicated by the TA to the TE. Character set used in <text> is as |
  687. | | specified by command Select TE Character Set +CSCS |
  688. +------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  689. | 2 | display event reporting using result code +CDEV: <elem>,<text>. All display events shall be directed from TA to TE. Character set used in <text> is as |
  690. | | specified by command Select TE Character Set +CSCS |
  691. +------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  692. \endrst
  693. - \a bit6-bit7:use CFW_CFG_CMER_IND(mer) to get Ind.
  694. \rst
  695. +-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  696. | Ind value | Description |
  697. +===========+==============================================================================================================================================================+
  698. | 0 | no indicator event reporting |
  699. +-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  700. | 1 | indicator event reporting using result code +CIEV: <ind>,<value>. <ind> indicates the indicator order number (as specified for +CIND) and <value> is the new |
  701. | | value of indicator. Only those indicator events, which are not caused by +CIND shall be indicated by the TA to the TE |
  702. +-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  703. | 2 | indicator event reporting using result code +CIEV: <ind>,<value>. All indicator events shall be directed from TA to TE |
  704. +-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  705. \endrst
  706. - \a bit8-bit9:use CFW_CFG_CMER_BFR(mer) to get bfr.
  707. \rst
  708. +-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  709. | Bfr value | Description |
  710. +===========+========================================================================================================================================================+
  711. | 0 | TA buffer of unsolicited result codes defined within this command is cleared when <mode> 1...3 is entered |
  712. +-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  713. | 1 | TA buffer of unsolicited result codes defined within this command is flushed to the TE when <mode> 1...3 is entered (OK response shall be given before |
  714. | | flushing the codes) |
  715. +-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  716. \endrst
  717. \return \a ERR_SUCCESS on success, or error code
  718. - \a ERR_CFW_INVALID_PARAMETER The input parameter(nFac) is invalid.
  719. */
  720. uint32_t CFW_CfgGetEventReport(
  721. uint16_t *pMer);
  722. /*! \brief function controls the presentation of the event reporting.
  723. \param [in] pMer Specify the presentation of the event reporting, you can pass CFW_CFG_CMER(mode,keyp,disp,ind,bfr) to this parameter.
  724. \return \a ERR_SUCCESS on success, or error code
  725. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  726. */
  727. uint32_t CFW_CfgSetEventReport(
  728. uint16_t pMer);
  729. /*! \brief function sets the result code present mode of the phone.
  730. \param [in] nMode Specify the result code present mode(0-1).
  731. \return \a ERR_SUCCESS on success, or error code
  732. - \a ERR_CFW_INVALID_SERVICE The input parameter nServiceId is invalid.
  733. */
  734. uint32_t CFW_CfgSetResultCodePresentMode(
  735. uint8_t nMode);
  736. /*! \brief function sets the result code format of the phone.
  737. \param [in] nMode Specify the format mode(0-1).
  738. \return \a ERR_SUCCESS on success, or error code
  739. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  740. */
  741. uint32_t CFW_CfgSetResultCodeFormatMode(
  742. uint8_t nMode);
  743. /*! \brief function retrieves the result code present mode of the phone.
  744. \param [out] nMode Pointer to the result code present mode.
  745. \return \a ERR_SUCCESS on success, or error code
  746. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  747. */
  748. uint32_t CFW_CfgGetResultCodePresentMode(
  749. uint8_t *pMode);
  750. /*! \brief function retrieves the result code format mode of the phone.
  751. \param [out] nMode Pointer to the result code format mode.
  752. \return \a ERR_SUCCESS on success, or error code
  753. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  754. */
  755. uint32_t CFW_CfgGetResultCodeFormatMode(
  756. uint8_t *pMode);
  757. /*! \brief function retrieves product identification information.
  758. \param [out] pIdText Pointer to character string of product identification information ended with 0.
  759. \return \a ERR_SUCCESS on success, or error code
  760. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  761. */
  762. uint32_t CFW_CfgGetProductIdentification(
  763. uint8_t *pIdText);
  764. /*! \brief function retrieves an extended error report of the reason for the last call release and location.
  765. \param [out] pErrReport Pointer to PSTR type to retrieve the error string shown in Location ID table.
  766. \return \a ERR_SUCCESS on success, or error code
  767. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  768. */
  769. uint32_t CFW_CfgGetExtendedErrorV0(
  770. const char **pErrReport);
  771. /*! \brief function set an extended error report of the reason for the last call release and location.
  772. \param [in] pErrReport Specify the error code of Location ID.
  773. \return \a ERR_SUCCESS on success, or error code
  774. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  775. */
  776. uint32_t CFW_CfgSetExtendedErrorV0(
  777. uint32_t nErrorCode);
  778. /*! \brief function controls the presentation of the result codes.
  779. \param [in] nMode Specify the mode. This parameter can be one of the following value:
  780. \rst
  781. +-------+-----------------------------------------------------------------------------+
  782. | nMode | Description |
  783. +=======+=============================================================================+
  784. | 0 | DCE does not echo characters during command state and online command state. |
  785. +-------+-----------------------------------------------------------------------------+
  786. | 1 | DCE echoes characters during command state and online command state. |
  787. +-------+-----------------------------------------------------------------------------+
  788. \endrst
  789. \return \a ERR_SUCCESS on success, or error code
  790. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  791. */
  792. uint32_t CFW_CfgSetEchoMode(
  793. uint8_t nMode);
  794. /*! \brief function controls the presentation of the result codes.
  795. \param [out] nMode Specify the mode. This parameter can be one of the following value:
  796. \rst
  797. +-------+-----------------------------------------------------------------------------+
  798. | nMode | Description |
  799. +=======+=============================================================================+
  800. | 0 | DCE does not echo characters during command state and online command state. |
  801. +-------+-----------------------------------------------------------------------------+
  802. | 1 | DCE echoes characters during command state and online command state. |
  803. +-------+-----------------------------------------------------------------------------+
  804. \endrst
  805. \return \a ERR_SUCCESS on success, or error code
  806. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  807. */
  808. uint32_t CFW_CfgGetEchoMode(
  809. uint8_t *nMode);
  810. typedef struct _CFW_EXTENDED_ERROR
  811. {
  812. uint8_t locationId;
  813. uint8_t reason;
  814. uint8_t ss_reason;
  815. uint8_t padding;
  816. } CFW_EXTENDED_ERROR;
  817. /*! \brief function retrieves an extended error report of the reason for the last call release and location.
  818. \param [in] pExtendedError Pointer to CFW_EXTENDED_ERROR structure to contain the extended error.
  819. \return \a ERR_SUCCESS on success, or error code
  820. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  821. */
  822. uint32_t CFW_CfgGetExtendedErrorV1(
  823. CFW_EXTENDED_ERROR *pExtendedError);
  824. /*! \brief function retrieves the error information.
  825. \param [out] pLevel Specify the error level to report. This parameter can be one of the following value:
  826. \rst
  827. +-------+------------------------------------------------------+
  828. | nMode | Description |
  829. +=======+======================================================+
  830. | 0 | disable result code (only 'ERROR' will be displayed) |
  831. +-------+------------------------------------------------------+
  832. | 1 | enable result code and use numeric values |
  833. +-------+------------------------------------------------------+
  834. | 2 | enable result code and use verbose values |
  835. +-------+------------------------------------------------------+
  836. \endrst
  837. \return \a ERR_SUCCESS on success, or error code
  838. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  839. */
  840. uint32_t CFW_CfgGetErrorReport(
  841. uint8_t *pLevel);
  842. /*! \brief function controls the presentation of the result codes.
  843. \param [in] nLevel Specify the error level to report. This parameter can be one of the following value:
  844. \rst
  845. +-------+------------------------------------------------------+
  846. | nMode | Description |
  847. +=======+======================================================+
  848. | 0 | disable result code (only 'ERROR' will be displayed) |
  849. +-------+------------------------------------------------------+
  850. | 1 | enable result code and use numeric values |
  851. +-------+------------------------------------------------------+
  852. | 2 | enable result code and use verbose values |
  853. +-------+------------------------------------------------------+
  854. \endrst
  855. \return \a ERR_SUCCESS on success, or error code
  856. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  857. */
  858. uint32_t CFW_CfgSetErrorReport(
  859. uint8_t nLevel);
  860. uint32_t CFW_CfgDeviceSwithOff(void);
  861. uint32_t CFW_CfgSetConnectResultFormatCode(
  862. uint8_t nValue);
  863. uint32_t CFW_CfgGetConnectResultFormatCode(
  864. uint8_t *nValue);
  865. uint32_t CFW_CfgSetSoftReset(
  866. uint8_t cause);
  867. uint32_t CFW_CfgGetSoftReset(
  868. uint8_t *cause);
  869. uint32_t CFW_CfgSetResetCause(
  870. uint8_t cause);
  871. uint32_t CFW_CfgGetResetCause(
  872. uint8_t *cause);
  873. typedef enum
  874. {
  875. CFW_SIM_ABSENT = 0x00,
  876. CFW_SIM_NORMAL = 0x01,
  877. CFW_SIM_TEST = 0x02,
  878. CFW_SIM_ABNORMAL = 0x03,
  879. CFW_SIM_STATUS_END = 0x04,
  880. CFW_SIM_TYPE_SOFT = 0x05,
  881. CFW_SIM_STATUS_ENUM_FILL = 0x7fffffff
  882. } CFW_SIM_STATUS;
  883. void CFW_SetSimStatus(
  884. CFW_SIM_ID nSimID,
  885. CFW_SIM_STATUS nSimStatus);
  886. CFW_SIM_STATUS CFW_GetSimStatus(
  887. CFW_SIM_ID nSimID);
  888. uint8_t CFW_GetSimPHYType(
  889. CFW_SIM_ID nSimID);
  890. bool CFW_GetSimType(
  891. CFW_SIM_ID nSimID);
  892. /*! \close the sim.
  893. The result should be returned through the following \a EV_CFW_SIM_CLOSE_RSP event:
  894. \rst
  895. +------+-------+---------+---------+-------------+
  896. | UTI | nType | nParam1 | nParam2 | Description |
  897. +======+=======+=========+=========+=============+
  898. | nUTI | 0 | 0 | 0 | OK |
  899. +------+-------+---------+---------+-------------+
  900. \endrst
  901. \param [in] nUTI UTI operation
  902. \param [in] nSimID SIM ID
  903. \return \a ERR_SUCCESS on success, or error code
  904. */
  905. uint32_t CFW_SimClose(
  906. uint16_t nUTI,
  907. CFW_SIM_ID nSimID);
  908. uint32_t CFW_GetStackSimFileID(
  909. uint16_t n3GppFileID,
  910. uint16_t EFPath,
  911. CFW_SIM_ID nSimID);
  912. uint32_t CFW_GetStackSimFileIDByPath_V2(
  913. uint16_t n3GppFileID,
  914. uint8_t *EFTotalPath,
  915. uint8_t iEfPathLength,
  916. CFW_SIM_ID nSimID);
  917. uint32_t CFW_SimReadBinary(
  918. uint8_t nFileId,
  919. uint8_t nOffset,
  920. uint8_t nBytesToRead,
  921. uint16_t nUTI,
  922. CFW_SIM_ID nSimID);
  923. uint32_t CFW_SimReadElementary(
  924. uint8_t nFileId,
  925. uint16_t nUTI,
  926. CFW_SIM_ID nSimID);
  927. uint32_t CFW_SimUpdateBinary(
  928. uint8_t nFileId,
  929. uint8_t nOffset,
  930. uint8_t *pData,
  931. uint8_t nBytesToWrite,
  932. uint16_t nUTI,
  933. CFW_SIM_ID nSimID);
  934. uint32_t CFW_SimReadRecord(
  935. uint8_t nFileID,
  936. uint8_t nRecordNum,
  937. uint16_t nUTI,
  938. CFW_SIM_ID nSimID);
  939. uint32_t CFW_SimUpdateRecord(
  940. uint8_t nFileID,
  941. uint8_t nRecordNum,
  942. uint8_t nRecordSize,
  943. uint8_t *pData,
  944. uint16_t nUTI,
  945. CFW_SIM_ID nSimID);
  946. uint32_t CFW_SimUpdateRecordAllParam(
  947. uint8_t nFileID,
  948. uint8_t nRecordNum,
  949. uint8_t nRecordSize,
  950. uint8_t nRecordMode,
  951. uint8_t *pData,
  952. uint16_t nUTI,
  953. CFW_SIM_ID nSimID);
  954. uint32_t CFW_SimReadRecordWithLen(
  955. uint8_t nFileID,
  956. uint8_t nRecordNum,
  957. uint16_t nLen,
  958. uint16_t nUTI,
  959. CFW_SIM_ID nSimID);
  960. uint32_t CFW_SimReadRecordAllParam(
  961. uint8_t nFileID,
  962. uint8_t nRecordNum,
  963. uint8_t nRecordMode,
  964. uint16_t nLen,
  965. uint16_t nUTI,
  966. CFW_SIM_ID nSimID);
  967. uint32_t CFW_SimGetFileStatus(
  968. uint8_t nFileID,
  969. uint16_t nUTI,
  970. CFW_SIM_ID nSimID);
  971. uint32_t CFW_SimReadFiles(
  972. uint8_t *pSimFile,
  973. uint8_t nSimFile,
  974. uint16_t nUTI,
  975. CFW_SIM_ID nSimID);
  976. //SIM Switch
  977. uint32_t CFW_CfgSetSimSwitch(
  978. uint8_t n);
  979. uint32_t CFW_CfgGetSimSwitch(
  980. uint8_t *n);
  981. uint32_t CFW_SwitchDualSimSlot(
  982. uint8_t nSimSlot);
  983. void SimSwitch(
  984. uint8_t SimNum);
  985. uint32_t CFW_SimGetOperationTimes();
  986. // PBK Configuration
  987. #define CFW_PBK_SIM 0x01
  988. #define CFW_PBK_ME 0x02
  989. #define CFW_PBK_ME_MISSED 0x1
  990. #define CFW_PBK_ME_RECEIVED 0x2
  991. #define CFW_PBK_SIM_FIX_DIALLING 0x4
  992. #define CFW_PBK_SIM_LAST_DIALLING 0x8
  993. #define CFW_PBK_ME_LAST_DIALLING 0x10
  994. #define CFW_PBK_SIM_BARRED_DIALLING 0x11
  995. #define CFW_PBK_SIM_SERVICE_DIALLING 0x12
  996. #define CFW_PBK_ON 0x20
  997. #define CFW_PBK_EN 0x40
  998. #define CFW_PBK_SDN 0x80
  999. #define CFW_PBK_AUTO 0x00
  1000. #define CFW_PBK_ALL 0x00
  1001. // Pbk Option
  1002. #define CFW_PBK_OPTION_BASIC 0x00
  1003. #define CFW_PBK_OPTION_All 0x01
  1004. #define CFW_PBK_OPTION_BASIC_NAME_DESCEND_ORDER 0x04
  1005. #define CFW_PBK_OPTION_BASIC_NAME_ASCEND_ORDER 0x08
  1006. #define CFW_PBK_OPTION_All_NAME_DESCEND_ORDER 0x10
  1007. #define CFW_PBK_OPTION_All_NAME_ASCEND_ORDER 0x20
  1008. /*! \brief The CFW_GetSimAdnId function to get the Sim AdnId
  1009. \param [in] nSimID SIMID
  1010. \return
  1011. Sim AdnId
  1012. */
  1013. uint8_t CFW_GetSimAdnId(CFW_SIM_ID nSimID);
  1014. typedef struct _CFW_PBK_STRORAGE_INFO
  1015. {
  1016. uint16_t index;
  1017. uint8_t iNumberLen;
  1018. uint8_t txtLen;
  1019. uint8_t Bitmap[63];
  1020. } CFW_PBK_STRORAGE_INFO;
  1021. uint32_t CFW_CfgGetPbkStrorageInfo(
  1022. CFW_PBK_STRORAGE_INFO *pStorageInfo);
  1023. uint32_t CFW_CfgSetPbkStrorageInfo(
  1024. CFW_PBK_STRORAGE_INFO *pStorageInfo);
  1025. // NW Configuration
  1026. #define CFW_STORE_MAX_COUNT 33
  1027. typedef struct //this must be the same with api_NwStoreListInd_t
  1028. {
  1029. uint8_t Plmn[3];
  1030. uint8_t nCount;
  1031. uint16_t ArfcnL[CFW_STORE_MAX_COUNT];
  1032. } CFW_StoredPlmnList;
  1033. typedef struct _CFW_SIMSTATUS
  1034. {
  1035. bool UsimFlag;
  1036. } CFW_SIMSTATUS;
  1037. typedef struct _CFW_SIM_PHY_TYPE
  1038. {
  1039. uint8_t iSimPhycialType;
  1040. } CFW_SIM_PHY_TYPE;
  1041. typedef struct _NW_SIM_INFO
  1042. {
  1043. CFW_StoredPlmnList p_StoreList[CFW_SIM_COUNT];
  1044. uint8_t SimStatus; // 0: sim; 1: Usim
  1045. } CFW_SIM_INFO;
  1046. /*! \brief function retrieves the operator names by operator identifier.
  1047. \param [in] nStorage Specify the current phonebook memory storage. This parameter can be one of the following value:
  1048. \rst
  1049. +----------------+-------+----------------------------------------------+
  1050. | Memory Storage | Value | nParam2 |
  1051. +================+=======+==============================================+
  1052. | CFW_PBK_SIM | 0x01 | SIM phonebook (storage depends on SIM Card). |
  1053. +----------------+-------+----------------------------------------------+
  1054. | CFW_PBK_ME | 0x02 | ME Phonebook. |
  1055. +----------------+-------+----------------------------------------------+
  1056. | CFW_PBK_ON | 0x20 | SIM (or ME) own numbers (MSISDNs) list. |
  1057. +----------------+-------+----------------------------------------------+
  1058. | CFW_PBK_EN | 0x40 | Emergency Call storage |
  1059. +----------------+-------+----------------------------------------------+
  1060. \endrst
  1061. \param [in] nSimID SIM ID
  1062. \return \a ERR_SUCCESS on success, or error code
  1063. */
  1064. uint32_t CFW_CfgSetPbkStorage(
  1065. uint8_t nStorage,
  1066. CFW_SIM_ID nSimID);
  1067. /*! \brief function retrieves the operator names by operator identifier.
  1068. \param [out] nStorage Specify the current phonebook memory storage. This parameter can be one of the following value:
  1069. \rst
  1070. +----------------+-------+----------------------------------------------+
  1071. | Memory Storage | Value | nParam2 |
  1072. +================+=======+==============================================+
  1073. | CFW_PBK_SIM | 0x01 | SIM phonebook (storage depends on SIM Card). |
  1074. +----------------+-------+----------------------------------------------+
  1075. | CFW_PBK_ME | 0x02 | ME Phonebook. |
  1076. +----------------+-------+----------------------------------------------+
  1077. | CFW_PBK_ON | 0x20 | SIM (or ME) own numbers (MSISDNs) list. |
  1078. +----------------+-------+----------------------------------------------+
  1079. | CFW_PBK_EN | 0x40 | Emergency Call storage |
  1080. +----------------+-------+----------------------------------------------+
  1081. \endrst
  1082. \param [in] nSimID SIM ID
  1083. \return \a ERR_SUCCESS on success, or error code
  1084. */
  1085. uint32_t CFW_CfgGetPbkStorage(
  1086. uint8_t *nStorage,
  1087. CFW_SIM_ID nSimID);
  1088. uint32_t CFW_CfgSetStoredPlmnList(
  1089. CFW_StoredPlmnList *pPlmnL,
  1090. CFW_SIM_ID nSimId);
  1091. uint32_t CFW_CfgGetStoredPlmnList(
  1092. CFW_StoredPlmnList *pPlmnL,
  1093. CFW_SIM_ID nSimId);
  1094. uint32_t CFW_CfgNwSetLockedFrequencyBand(
  1095. uint8_t nBand,
  1096. CFW_SIM_ID nSimID);
  1097. uint32_t CFW_CfgNwGetLockedFrequencyBand(
  1098. uint8_t *pBand,
  1099. CFW_SIM_ID nSimID);
  1100. uint32_t CFW_CfgNwSetFrequencyBand(
  1101. uint8_t nBand,
  1102. CFW_SIM_ID nSimID);
  1103. uint32_t CFW_CfgNwGetFrequencyBand(
  1104. uint8_t *pBand,
  1105. CFW_SIM_ID nSimID);
  1106. uint32_t CFW_CfgNwGetNetWorkMode(
  1107. uint8_t *pMode,
  1108. CFW_SIM_ID nSimID);
  1109. uint32_t CFW_CfgNwSetNetWorkMode(
  1110. uint8_t nMode,
  1111. CFW_SIM_ID nSimID);
  1112. /*! \brief The CFW_SetCDACValue function set the cdac value
  1113. \param [in] nCdac cdac value from 0 ~ 255
  1114. \param [in] bSaveFlag 1 save to flash, 0 donot save to flash
  1115. \return \a ERR_SUCCESS on success, or error code
  1116. */
  1117. uint32_t CFW_SetCDACValue(uint8_t nCdac, bool bSaveFlag);
  1118. /*! \brief The CFW_GetCDACValue function get the cdac value
  1119. \param [out] pCdac cdac value from 0 ~ 255
  1120. \return \a ERR_SUCCESS on success, or error code
  1121. */
  1122. uint32_t CFW_GetCDACValue(uint8_t *pCdac);
  1123. /*! \brief function retrieves the network status presentation mode.
  1124. \param [out] pCmd Specify the how to control the network status report, this parameter can be one of the following value:
  1125. \rst
  1126. +-------+---------------------------------------------------------------------------------------------------------------+
  1127. | value | Description |
  1128. +=======+===============================================================================================================+
  1129. | 0 | disable URCs |
  1130. +-------+---------------------------------------------------------------------------------------------------------------+
  1131. | 1 | enable URC +CREG:<stat> to report status of network registration |
  1132. +-------+---------------------------------------------------------------------------------------------------------------+
  1133. | 2 | enable URC +CREG:<stat>[,<lac>,<ci>] to report status of network registration including location information. |
  1134. | | Please note that optional parameters will not be displayed during call. |
  1135. +-------+---------------------------------------------------------------------------------------------------------------+
  1136. \endrst
  1137. \param [in] nSimID SIM ID
  1138. \return \a ERR_SUCCESS on success, or error code
  1139. */
  1140. uint32_t CFW_CfgGetNwStatus(
  1141. uint8_t *pCmd,
  1142. CFW_SIM_ID nSimID);
  1143. /*! \brief function sets the network status presentation mode.
  1144. \param [in] n Specify the how to conctrol the network status report, this parameter can be one of the following value:
  1145. \rst
  1146. +-------+---------------------------------------------------------------------------------------------------------------------+
  1147. | value | Description |
  1148. +=======+=====================================================================================================================+
  1149. | 0 | disable to report the network status information. |
  1150. +-------+---------------------------------------------------------------------------------------------------------------------+
  1151. | 1 | enable send EV_CFW_NW_REG_STATUS_IND event to report status of network registration |
  1152. +-------+---------------------------------------------------------------------------------------------------------------------+
  1153. | 2 | enable send EV_CFW_NW_REG_STATUS_IND event to report status of network registration including location information. |
  1154. +-------+---------------------------------------------------------------------------------------------------------------------+
  1155. \endrst
  1156. \param [in] nSimID SIM ID
  1157. \return \a ERR_SUCCESS on success, or error code
  1158. */
  1159. uint32_t CFW_CfgSetNwStatus(
  1160. uint8_t n,
  1161. CFW_SIM_ID nSimID);
  1162. /*! \brief function retrieves the operator names according to the input index (based on zero) .
  1163. \param [out] pOperatorId Specify the operator identifier in digital format,if the ID length is 5,the array should terminated with 0x0F. For example,the id is 0X04,0X06,0X00,0X00,0X00,0X0F,and its corresponding full name is "China Mobile"
  1164. \param [out] pOperatorName Pointer to the buffer to hold the operator name in ASCII string format with zero-terminated
  1165. \param [in] nIndex Specify the based-zero index(0 - 31).
  1166. \return \a ERR_SUCCESS on success, or error code
  1167. - \a ERR_CFW_INVALID_PARAMETER (The input parameter is NULL)
  1168. - \a ERR_CFW_NOT_EXIST_OPERATOR_ID (Don't find any operator identifier in the system)
  1169. - \a ERR_CFG_PARAM_OUT_RANGR
  1170. */
  1171. uint32_t CFW_CfgNwGetOperatorInfo(
  1172. uint8_t **pOperatorId,
  1173. uint8_t **pOperatorName,
  1174. uint32_t nIndex);
  1175. /*! \brief function retrieves the T3302 value.
  1176. \return \a T3302 value
  1177. */
  1178. uint32_t CFW_GetT3302(CFW_SIM_ID nSimID);
  1179. /*! \brief function set T3302 value.
  1180. \param [in] value T3302 value.
  1181. \return \a ERR_SUCCESS on success
  1182. */
  1183. uint32_t CFW_SetT3302(uint32_t value, CFW_SIM_ID nSimID);
  1184. /*! \brief function retrieves the RRC release value.
  1185. \return \a RRC release value
  1186. */
  1187. uint32_t CFW_GetRRCRel(CFW_SIM_ID nSimID);
  1188. /*! \brief function set the RRC release value.
  1189. \param [in] value RRC release value.
  1190. \return \a ERR_SUCCESS on success
  1191. */
  1192. uint32_t CFW_SetRRCRel(uint32_t value, CFW_SIM_ID nSimID);
  1193. /*! \brief function retrieves the RRC release value.
  1194. \param [in] value sim index.
  1195. \return \a RRC release value
  1196. */
  1197. uint32_t CFW_GetRRCRelEx(
  1198. CFW_SIM_ID nSimID);
  1199. /*! \brief function set the RRC release value.
  1200. \param [in] value RRC release value.
  1201. \param [in] sim index.
  1202. \return \a ERR_SUCCESS on success
  1203. */
  1204. uint32_t CFW_SetRRCRelEx(
  1205. uint32_t value,
  1206. CFW_SIM_ID nSimID);
  1207. uint16_t CFW_GetDrxCyc(
  1208. CFW_SIM_ID nSimID);
  1209. /*! \brief function get the electric fence cell flag.
  1210. \return \a electric fence cell flag value
  1211. */
  1212. uint32_t CFW_GetEleFence(
  1213. CFW_SIM_ID nSimID);
  1214. /*! \brief function set the electric fence cell flag.
  1215. \param [in] electric fence cell flag value(0: Enable the electric fence; 1: Disable the electric fence).
  1216. \return \a ERR_SUCCESS on success
  1217. */
  1218. uint32_t CFW_SetEleFence(
  1219. uint8_t value,
  1220. CFW_SIM_ID nSimID);
  1221. /*! \brief function get the electric fence cell timer.
  1222. \return \a electric fence cell timer value
  1223. */
  1224. uint32_t CFW_GetEleFenceTimer(
  1225. CFW_SIM_ID nSimID);
  1226. /*! \brief function set the electric fence cell timer.
  1227. \param [in] electric fence cell timer value.
  1228. \return \a ERR_SUCCESS on success
  1229. */
  1230. uint32_t CFW_SetEleFenceTimer(
  1231. uint8_t value,
  1232. CFW_SIM_ID nSimID);
  1233. /*! \brief function retrieves the operator ID by operator name.
  1234. \param [out] pOperatorId Specify the operator identifier in digital format,if the ID length is 5,the array should terminated with 0x0F. For example,the id is 0X04,0X06,0X00,0X00,0X00,0X0F,and its corresponding full name is "China Mobile"
  1235. \param [in] format Out the pOperatorName format.
  1236. \param [in] pOperatorName Pointer to the buffer to hold the operator name in ASCII string format with zero-terminated
  1237. \return \a ERR_SUCCESS on success, or error code
  1238. - \a ERR_CFW_INVALID_PARAMETER (The input parameter is NULL)
  1239. - \a ERR_CFW_NOT_EXIST_OPERATOR_NAME (Don't find any specific operator name in the system)
  1240. - \a ERR_CFG_PARAM_OUT_RANGR
  1241. */
  1242. uint32_t CFW_CfgNwGetOperatorId(
  1243. uint8_t **pOperatorId,
  1244. uint8_t format,
  1245. uint8_t *pOperatorName);
  1246. uint32_t CFW_CfgNwGetOperatorIdWithIndex(
  1247. uint8_t pOperatorId[6],
  1248. uint8_t *pOperatorName,
  1249. uint8_t format,
  1250. uint32_t *nIndex);
  1251. /*! \brief function retrieves the operator names by operator identifier.
  1252. \param [in] pOperatorId Specify the operator identifier in digital format,if the ID length is 5,the array should terminated with 0x0F. For example,the id is 0X04,0X06,0X00,0X00,0X00,0X0F,and its corresponding full name is "China Mobile"
  1253. \param [out] pOperatorName Pointer to the buffer to hold the operator long name in ASCII string format with zero-terminated
  1254. \param [out] pOperatorShortName Pointer to the buffer to hold the operator short name in ASCII string format with zero-terminated
  1255. \return \a ERR_SUCCESS on success, or error code
  1256. - \a ERR_CFW_INVALID_PARAMETER (The input parameter is NULL)
  1257. - \a ERR_CFW_NOT_EXIST_OPERATOR_ID (Don't find any operator identifier in the system)
  1258. - \a ERR_CFG_PARAM_OUT_RANGR
  1259. */
  1260. uint32_t CFW_CfgNwGetOperatorName(
  1261. uint8_t pOperatorId[6],
  1262. uint8_t **pOperatorName,
  1263. uint8_t **pOperatorShortName);
  1264. uint32_t CFW_CfgSetNwOperDispFormat(
  1265. uint8_t nFormat);
  1266. uint32_t CFW_CfgGetNwOperDispFormat(
  1267. uint8_t *nFormat);
  1268. //if gsmGprsOnly is 1,we will not register for GSM-only network.
  1269. uint32_t CFW_GetGsmGprsOnly(
  1270. CFW_SIM_ID nSimID);
  1271. uint32_t CFW_SetGsmGprsOnly(
  1272. uint8_t value, CFW_SIM_ID nSimID);
  1273. // CM Configuration
  1274. uint32_t CFW_CfgSetSSN(
  1275. uint8_t nCSSI,
  1276. uint8_t nCSSU,
  1277. CFW_SIM_ID nSimID);
  1278. uint32_t CFW_CfgGetSSN(
  1279. uint8_t *pCSSI,
  1280. uint8_t *pCSSU,
  1281. CFW_SIM_ID nSimID);
  1282. /*! \brief function enables or disables the presentation of the CLI (Calling Line Identification).
  1283. \param [in] nClir This parameter can be one of the following value:
  1284. \rst
  1285. +-------+----------------------------------------------------------------------------------+
  1286. | nClir | Description |
  1287. +=======+==================================================================================+
  1288. | 0 | presentation indicator is used according to the subscription of the CLIR service |
  1289. +-------+----------------------------------------------------------------------------------+
  1290. | 1 | CLIR invocation |
  1291. +-------+----------------------------------------------------------------------------------+
  1292. | 2 | CLIR suppression |
  1293. +-------+----------------------------------------------------------------------------------+
  1294. \endrst
  1295. \param [in] nSimID SIM ID
  1296. \return \a ERR_SUCCESS on success, or error code
  1297. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  1298. */
  1299. uint32_t CFW_CfgSetClir(
  1300. uint8_t nClir,
  1301. CFW_SIM_ID nSimID);
  1302. /*! \brief function queries the setting of restriction of the CLI (Calling Line Identification).
  1303. \param [out] n Pointer to UINT8 to show the settings for outgoing calls, this parameter can be on of the following value:
  1304. \rst
  1305. +-----+----------------------------------------------------------------------------------+
  1306. | n | Description |
  1307. +=====+==================================================================================+
  1308. | 0 | presentation indicator is used according to the subscription of the CLIR service |
  1309. +-----+----------------------------------------------------------------------------------+
  1310. | 1 | CLIR invocation |
  1311. +-----+----------------------------------------------------------------------------------+
  1312. | 2 | CLIR suppression |
  1313. +-----+----------------------------------------------------------------------------------+
  1314. \endrst
  1315. \param [in] nSimID SIM ID
  1316. \return \a ERR_SUCCESS on success, or error code
  1317. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  1318. */
  1319. uint32_t CFW_CfgGetClir(
  1320. uint8_t *n,
  1321. CFW_SIM_ID nSimID);
  1322. /*! \brief function enables or disables the presentation of the CLI (Calling Line Identification).
  1323. \param [in] nEnable 1 indicate presentation of the CLI; and 0 means don't presentation of the CLI.
  1324. \param [in] nSimID SIM ID
  1325. \return \a ERR_SUCCESS on success, or error code
  1326. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  1327. */
  1328. uint32_t CFW_CfgSetClip(
  1329. uint8_t nEnable,
  1330. CFW_SIM_ID nSimID);
  1331. /*! \brief function enables or disables the presentation of the CLI (Calling Line Identification).
  1332. \param [out] n
  1333. \rst
  1334. +-----+--------------------------------------+
  1335. | n | Description |
  1336. +=====+======================================+
  1337. | 0 | means don't presentation of the CLI. |
  1338. +-----+--------------------------------------+
  1339. | 1 | indicate presentation of the CLI. |
  1340. +-----+--------------------------------------+
  1341. \endrst
  1342. \param [in] nSimID SIM ID
  1343. \return \a ERR_SUCCESS on success, or error code
  1344. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  1345. */
  1346. uint32_t CFW_CfgGetClip(
  1347. uint8_t *n,
  1348. CFW_SIM_ID nSimID);
  1349. /*! \brief function enables or disables a calling subscriber to get the connected line identity (COL) of the called party after setting up a mobile originated call.
  1350. See 3GPP TS 22.081 [3] for more.
  1351. \param [in] n shows the result code presentation status. This parameter can be one of the following value:
  1352. \rst
  1353. +-----+--------------------------+
  1354. | n | Description |
  1355. +=====+==========================+
  1356. | 0 | Disable to show the COLP |
  1357. +-----+--------------------------+
  1358. | 1 | Enable to show the COLP |
  1359. +-----+--------------------------+
  1360. \endrst
  1361. \param [in] nSimID SIM ID
  1362. \return \a ERR_SUCCESS on success, or error code
  1363. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  1364. */
  1365. uint32_t CFW_CfgSetColp(
  1366. uint8_t n,
  1367. CFW_SIM_ID nSimID);
  1368. /*! \brief function retrieves the enables or disables setting of the connected line identity (COL) of the called party after setting up a mobile originated call.
  1369. See 3GPP TS 22.081 [3] for more.
  1370. \param [out] n Point to UINT8 to hold the result code presentation status. This parameter can be one of the following value:
  1371. \rst
  1372. +-----+--------------------------+
  1373. | n | Description |
  1374. +=====+==========================+
  1375. | 0 | Disable to show the COLP |
  1376. +-----+--------------------------+
  1377. | 1 | Enable to show the COLP |
  1378. +-----+--------------------------+
  1379. \endrst
  1380. \param [in] nSimID SIM ID
  1381. \return \a ERR_SUCCESS on success, or error code
  1382. - \a ERR_CFW_INVALID_PARAMETER The input parameter is NULL.
  1383. */
  1384. uint32_t CFW_CfgGetColp(
  1385. uint8_t *n,
  1386. CFW_SIM_ID nSimID);
  1387. /*! \brief function sets the presentations status of call waiting in the MT/TA:
  1388. \param [in] n sets/shows the result code presentation status in the MT/TA, If you don't need this parameter, set this parameter to 0xFF,
  1389. the system will select the default value to zero. (sets/shows the result code presentation status in the MT/TA):
  1390. \param [in] nSimID SIM ID
  1391. \return \a ERR_SUCCESS on success, or error code
  1392. - \a ERR_CFW_INVALID_PARAMETER (The input parameter is NULL)
  1393. */
  1394. uint32_t CFW_CfgSetCallWaiting(
  1395. uint8_t n,
  1396. CFW_SIM_ID nSimID);
  1397. /*! \brief function sets the presentations status of call waiting in the MT/TA:
  1398. \param [out] n sets/shows the result code presentation status in the MT/TA, If you don't need this parameter, set this parameter to 0xFF,
  1399. the system will select the default value to zero. (sets/shows the result code presentation status in the MT/TA):
  1400. \param [in] nSimID SIM ID
  1401. \return \a ERR_SUCCESS on success, or error code
  1402. - \a ERR_CFW_INVALID_PARAMETER (The input parameter is NULL)
  1403. */
  1404. uint32_t CFW_CfgGetCallWaiting(
  1405. uint8_t *n,
  1406. CFW_SIM_ID nSimID);
  1407. uint32_t CFW_CfgGetIMSI(
  1408. uint8_t pIMSI[15],
  1409. CFW_SIM_ID nSimID);
  1410. uint32_t CFW_CfgSetIMSI(
  1411. uint8_t pIMSI[15],
  1412. CFW_SIM_ID nSimID);
  1413. typedef enum
  1414. {
  1415. CFW_CDMA_IMSI_NOT_INIT,
  1416. CFW_CDMA_IMSI_NOT_EXIST,
  1417. CFW_CDMA_IMSI_OK,
  1418. } CFW_CDMA_IMSI_STATUS;
  1419. uint32_t CFW_CfgGetCdmaImsi(
  1420. uint8_t pCdmaImsi[10],
  1421. CFW_SIM_ID nSimID);
  1422. #ifdef LTE_SUPPORT
  1423. uint32_t CFW_NwSetEpsMode(
  1424. uint8_t eps_mode,
  1425. CFW_SIM_ID nSimID);
  1426. #endif
  1427. uint32_t CFW_NwSetMaxAttFailForIratReq(
  1428. uint8_t nMaxNum,
  1429. CFW_SIM_ID nSimID);
  1430. uint8_t CFW_NwIsUseISIM(
  1431. char *plmnStr);
  1432. uint32_t CFW_CfgSetToneDuration(
  1433. uint8_t nToneDuration);
  1434. uint32_t CFW_CfgGetToneDuration(
  1435. uint8_t *pToneDuration);
  1436. uint32_t CFW_CfgSetIncomingCallResultMode(
  1437. uint8_t nMode);
  1438. uint32_t CFW_CfgGetIncomingCallResultMode(
  1439. uint8_t *nMode);
  1440. // Device Configuration
  1441. typedef struct _CFW_AUD_OUT_PARAMETER
  1442. {
  1443. uint8_t outBbcGain;
  1444. uint8_t outStep;
  1445. uint16_t sideTone;
  1446. uint16_t outCalibrate[4];
  1447. } CFW_AUD_OUT_PARAMETER;
  1448. uint32_t CFW_CfgSetAudioOutputParam(
  1449. CFW_AUD_OUT_PARAMETER *pAudOutParam);
  1450. uint32_t CFW_CfgGetAudioOutputParam(
  1451. CFW_AUD_OUT_PARAMETER *pAudOutParam);
  1452. uint32_t CFW_CfgSetAudioAudioMode(
  1453. uint8_t nAudioMode);
  1454. uint32_t CFW_CfgGetAudioAudioMode(
  1455. uint8_t *pAudioMode);
  1456. uint32_t CFW_CfgSetLoudspeakerVolumeLevel(
  1457. uint8_t nVolumeLevel);
  1458. uint32_t CFW_CfgGetLoudspeakerVolumeLevel(
  1459. uint8_t *pVolumeLevel);
  1460. uint32_t CFW_CfgGetLoudspeakerVolumeLevelRange(
  1461. uint8_t *pMinVolumeLevel,
  1462. uint8_t *pMaxVolumeLevel);
  1463. //
  1464. // NW Service
  1465. //
  1466. #define CFW_NW_STATUS_NOTREGISTERED_NOTSEARCHING 0 // Not registered and not searching.
  1467. #define CFW_NW_STATUS_REGISTERED_HOME 1 //Registered and in the home area.
  1468. #define CFW_NW_STATUS_NOTREGISTERED_SEARCHING 2 //Not registered and searching for a new operator.
  1469. #define CFW_NW_STATUS_REGISTRATION_DENIED 3 //Registration denied.
  1470. #define CFW_NW_STATUS_UNKNOW 4 //Unknown registration.
  1471. #define CFW_NW_STATUS_REGISTERED_ROAMING 5
  1472. #ifdef LTE_SUPPORT
  1473. #define CFW_NW_SMS_ONLY_HOME 6
  1474. #define CFW_NW_SMS_ONLY_ROAMING 7
  1475. #define CFW_NW_EMER_SVCE_ONLY 8
  1476. #define CFW_NW_CSFB_NOT_PREFER_HOME 9
  1477. #define CFW_NW_CSFB_NOT_PREFER_ROAMING 10
  1478. #endif
  1479. #define CFW_NW_AUTOMATIC_MODE 0
  1480. #define CFW_NW_MANUAL_MODE 1
  1481. #define CFW_NW_MANUAL_AUTOMATIC_MODE 4
  1482. #define CFW_NW_OPERATOR_STATUS_UNKNOW 0 //unknown
  1483. #define CFW_NW_OPERATOR_STATUS_AVAILABLE 1 //available
  1484. #define CFW_NW_OPERATOR_STATUS_CURRENT 2 //current
  1485. #define CFW_NW_OPERATOR_STATUS_FORBIDDEN 3 //forbidden
  1486. #define CFW_RAT_AUTO 0
  1487. #define CFW_RAT_GSM_ONLY 2
  1488. #define CFW_RAT_LTE_ONLY 4
  1489. #define CFW_RAT_NBIOT_ONLY 8
  1490. #define CFW_IPV4 0x01
  1491. #define CFW_IPV6 0x02
  1492. #define CFW_IPV4V6 0x03
  1493. #define CFW_PDP_EMPTY 0x04
  1494. #define DATA_PDP_CID 5
  1495. #define MAX_PCSCF_ADDR_NUMBER 6
  1496. //#ifdef CFW_VOLTE_SUPPORT //quectel modify
  1497. #define IMS_PDP_CID 11
  1498. #define IMS_PDP_APN "ims"
  1499. #define IMS_EMERGENCY_PDP_CID 9
  1500. #define CFW_IMSPDPACTIVE_MAX_COUNT (3)
  1501. typedef enum
  1502. {
  1503. IMS_PDP_STATUS_IDLE,
  1504. IMS_PDP_STATUS_CONNECT,
  1505. IMS_PDP_STATUS_ACTIVE,
  1506. IMS_PDP_STATUS_DISCONNECT,
  1507. IMS_PDP_STATUS_WAIT_RETRY,
  1508. IMS_PDP_STATUS_STOP,
  1509. IMS_PDP_STATUS_ENUM_FILL = 0x7fffffff
  1510. } CFW_IMS_PDP_STATUS;
  1511. typedef enum
  1512. {
  1513. IMS_NW_LTE_VOICE_NOT_SUPPORT = 0x00,
  1514. IMS_NW_CS_VOICE_ONLY,
  1515. IMS_NW_CS_VOICE_PREFER_PS_VOICE_SEC,
  1516. IMS_NW_PS_VOICE_PREFER_CS_VOICE_SEC,
  1517. IMS_NW_PS_VOICE_ONLY,
  1518. IMS_NW_VOICE_PREFERENCE_MAX,
  1519. IMS_NW_VOICE_ENUM_FILL = 0x7fffffff
  1520. } CFW_IMS_NW_VOICE_TYOE;
  1521. //#ifndef CFW_VOLTE_HANDSHAKE_SUPPORT
  1522. //#define CFW_VOLTE_HANDSHAKE_SUPPORT
  1523. //#endif
  1524. #ifdef CFW_VOLTE_HANDSHAKE_SUPPORT
  1525. typedef enum
  1526. {
  1527. HANDSHAKE_IDLE,
  1528. HANDSHAKE_GOING,
  1529. HANDSHAKE_SUCCESS,
  1530. HANDSHAKE_FAIL,
  1531. HANDSHAKE_RETRY,
  1532. HANDSHAKE_STOP,
  1533. HANDSHAKE_ENUM_FILL = 0x7fffffff
  1534. } CFW_IMS_HANDSHAKE_STATE;
  1535. extern uint8_t g_HandShakeRetryCount[];
  1536. extern uint8_t g_HandShakeMaxRetryCount[];
  1537. #endif
  1538. extern uint8_t gCfwImsPdpActiveCount[];
  1539. extern uint8_t gCfwImsRegetPcscf[];
  1540. uint32_t CFW_ImsInit(CFW_SIM_ID nSimID);
  1541. uint32_t CFW_ImsEnable(uint8_t isEmergency, uint16_t nUTI, CFW_SIM_ID nSimID);
  1542. uint32_t CFW_ImsDisable(uint8_t isEmergency, uint16_t nUTI, CFW_SIM_ID nSimID);
  1543. uint32_t CFW_ImsSuspend(CFW_SIM_ID nSimID, CFW_IMS_SUSPEND_TYPE nType);
  1544. uint32_t CFW_ImsResume(CFW_SIM_ID nSimID);
  1545. #ifdef CFW_VOLTE_HANDSHAKE_SUPPORT
  1546. uint32_t CFW_ImsHandShakeStartReq(uint32_t ReqSrc, CFW_SIM_ID nSimID);
  1547. uint32_t CFW_ImsHandShakeReqSrc(CFW_SIM_ID nSimID);
  1548. uint32_t CFW_ImsHandShakeEndReq(CFW_SIM_ID nSimID);
  1549. uint32_t CFW_ImsSetHandShankeRetryTimer(uint32_t nElapse, uint8_t nMaxRetry, CFW_SIM_ID nSimID);
  1550. #endif
  1551. uint32_t CFW_ImsSetDapsCallback(uint8_t nCid, CFW_SIM_ID nSimID);
  1552. uint32_t CFW_ImsSetVolte(uint8_t bSet, uint16_t nUTI, CFW_SIM_ID nSimID);
  1553. uint32_t CFW_ImsSetCevdp(uint8_t setting, uint16_t nUTI, CFW_SIM_ID nSimID);
  1554. uint32_t CFW_ImsSetTerminalMode(uint8_t setting, uint16_t nUTI, CFW_SIM_ID nSimID);
  1555. uint8_t CFW_ImsGetTerminalMode(CFW_SIM_ID nSimID);
  1556. uint32_t CFW_ImsSetSrvccMode(uint8_t ueSrvcc, uint16_t nUTI, CFW_SIM_ID nSimID);
  1557. uint8_t CFW_ImsGetSrvccMode(CFW_SIM_ID nSimID);
  1558. bool CFW_ImsIsSet(CFW_SIM_ID nSimID);
  1559. uint8_t CFW_ImsFreeUti(void);
  1560. uint32_t CFW_ImsActImsPdp(uint16_t nUTI, CFW_SIM_ID nSimID);
  1561. uint32_t CFW_ImsDoSavedEmcDail(void);
  1562. uint32_t CFW_ImsSetPdpStatus(uint8_t nStatus, uint8_t isEmergency, CFW_SIM_ID nSimID);
  1563. uint8_t CFW_ImsGetPdpStatus(uint8_t isEmergency, CFW_SIM_ID nSimID);
  1564. uint32_t CFW_ImsCheckStatusAfterCc(uint8_t nCsImsFlag, CFW_SIM_ID nSimID);
  1565. uint32_t CFW_SsSetClip(uint8_t set, uint16_t nUTI, CFW_SIM_ID nSimID);
  1566. uint32_t CFW_SsSetClir(uint8_t set, uint16_t nUTI, CFW_SIM_ID nSimID);
  1567. uint32_t CFW_SsSetColp(uint8_t set, uint16_t nUTI, CFW_SIM_ID nSimID);
  1568. bool CFW_ImsIsRegistered(uint8_t isEmergency, CFW_SIM_ID nSimID);
  1569. //#endif //quectel modify
  1570. //24008 10.5.3.13, listContent is copy start from octet 3
  1571. typedef struct _CFW_EMC_NUM_LIST_INFO
  1572. {
  1573. uint8_t plmn[3];
  1574. uint8_t lenOfNumList;
  1575. uint8_t listContent[48];
  1576. } CFW_NW_EMC_NUM_LIST_INFO;
  1577. typedef struct _CFW_NW_NETWORK_INFO
  1578. {
  1579. uint8_t nLocalTimeZoneLen;
  1580. uint8_t nLocalTimeZone;
  1581. uint8_t nUniversalTimeZoneLen;
  1582. uint8_t nUniversalTimeZone[7];
  1583. uint8_t nDaylightSavingTimeLen;
  1584. uint8_t nDaylightSavingTime;
  1585. uint8_t nNwkFullNameLen;
  1586. uint8_t nNwkShortNameLen;
  1587. uint8_t nNwkNames[247];
  1588. } CFW_NW_NETWORK_INFO;
  1589. typedef struct _CFW_NW_MBS_CELL_INFO
  1590. {
  1591. uint16_t nArfcn; // Abs Freq Number
  1592. uint8_t nBsic; // Base Station Code
  1593. uint8_t nCellId[2];
  1594. uint8_t nLai[5];
  1595. } CFW_NW_MBS_CELL_INFO;
  1596. typedef struct _CFW_NW_JAMMING_DETECT_GET_IND
  1597. {
  1598. uint8_t nMode; /*1: Jamming Detect Enabled; 0: Jamming Detect Disabled*/
  1599. uint8_t nJamming; /*Jamming Status, 1 means Jamming detected*/
  1600. } CFW_NW_JAMMING_DETECT_GET_IND;
  1601. #define CFW_MAX_JAMMING_FREQ_NUM (40)
  1602. typedef struct
  1603. {
  1604. uint32_t freq;
  1605. int16_t rssi;
  1606. uint16_t reserved;
  1607. } CFW_jammingFreqRssi_t;
  1608. typedef struct
  1609. {
  1610. uint8_t mode; /*API_RAT_GSM or API_RAT_LTE*/
  1611. uint8_t reserved;
  1612. uint16_t freqNum;
  1613. CFW_jammingFreqRssi_t jammingFreqRssi[CFW_MAX_JAMMING_FREQ_NUM];
  1614. } CFW_JAMMING_RSSI_ENQUIRY_RSP;
  1615. typedef struct _CFW_NW_QUAL_INFO
  1616. {
  1617. uint8_t nRssi;
  1618. uint8_t nRxQual;
  1619. int8_t iRsrp;
  1620. int8_t iRsrq;
  1621. int16_t nRssidBm;
  1622. int8_t Sinr;
  1623. } CFW_NW_QUAL_INFO;
  1624. typedef struct _CFW_NW_OPERATOR_INFO
  1625. {
  1626. uint8_t nOperatorId[6];
  1627. uint8_t nStatus;
  1628. uint8_t nRat;
  1629. } CFW_NW_OPERATOR_INFO;
  1630. typedef struct _CFW_NW_OPERATOR_INFO_V2
  1631. {
  1632. CFW_NW_OPERATOR_INFO nOperatorInfo;
  1633. int16_t nRsrp;
  1634. } CFW_NW_OPERATOR_INFO_V2;
  1635. #define NW_MAX_HNBNAME 48
  1636. typedef struct _CFW_NW_STATUS_INFO
  1637. {
  1638. uint8_t nStatus;
  1639. uint8_t nCause; //only use PS no service
  1640. uint8_t PsType; // 1: GPRS 2: EDGE 3: UMTS 4: NB-IoT 3: WB-EUTRAN(eg.CATM)
  1641. uint8_t nCsStatusChange; //add for if CS status have changed,we will set the TRUE.
  1642. uint8_t nAreaCode[5];
  1643. uint8_t nCurrRat;
  1644. uint8_t access;
  1645. #if (defined LTE_NBIOT_SUPPORT) || (defined LTE_SUPPORT)
  1646. uint8_t nCellId[4]; //cell id in umts is bitstring(28), so 4 bytes is necessary.
  1647. uint8_t cause_type;
  1648. uint8_t reject_cause;
  1649. uint8_t activeTime;
  1650. uint8_t periodicTau;
  1651. uint8_t nwSupportedCiot; //[0-3]
  1652. uint8_t edrxEnable; //0 off, 1 on
  1653. uint8_t edrxPtw; //[0-15]
  1654. uint8_t edrxValue; //[0-15]
  1655. uint8_t ConnMode;
  1656. uint16_t phyCellId;
  1657. uint32_t frequency;
  1658. #else
  1659. uint8_t nCellId[2];
  1660. #endif
  1661. uint16_t bsic;
  1662. uint16_t gsmFreq;
  1663. uint8_t StatusCause; //network reject cause for PS of GSM
  1664. #ifdef CSG_SUPPORT
  1665. uint8_t cellTypeId;
  1666. uint8_t csgTypeInd;
  1667. uint8_t hnbNameLength;
  1668. uint32_t csgId;
  1669. uint8_t hnbName[NW_MAX_HNBNAME];
  1670. #endif
  1671. //#ifdef CFW_VOLTE_SUPPORT //quectel modify
  1672. uint8_t nIMSVoPS;
  1673. uint8_t nImsPCSCFStatus;
  1674. uint8_t EMCBS;
  1675. //#endif //quectel modify
  1676. } CFW_NW_STATUS_INFO;
  1677. typedef struct
  1678. {
  1679. /*
  1680. 0 idle
  1681. 1 connected
  1682. */
  1683. uint8_t ConnMode;
  1684. /*
  1685. 0 UTRAN URA_PCH state
  1686. 1 UTRAN Cell_PCH state
  1687. 2 UTRAN Cell_FACH state
  1688. 3 UTRAN Cell_DCH state
  1689. 4 GERAN CS connected state
  1690. 5 GERAN PS connected state
  1691. 6 GERAN CS and PS connected state
  1692. 7 E-UTRAN connected state
  1693. */
  1694. uint8_t State;
  1695. /*
  1696. 0 Indicates usage of radio access of type GERAN, see 3GPP TS 45.001 [146].
  1697. 1 Indicates usage of radio access of type UTRAN TDD, see 3GPP TS 25.212 [144].
  1698. 2 Indicates usage of radio access of type UTRAN FDD, see 3GPP TS 25.212 [144].
  1699. 3 Indicates usage of radio access of type E-UTRAN TDD, see 3GPP TS 36.300 [145].
  1700. 4 Indicates usage of radio access of type E-UTRAN FDD, see 3GPP TS 36.300 [145].
  1701. */
  1702. uint8_t Access;
  1703. uint8_t rr_L1_ConnectState;
  1704. uint16_t Arfcn;
  1705. uint8_t Bsic;
  1706. uint8_t Lai[5];
  1707. uint8_t Rac;
  1708. uint8_t CellId[2];
  1709. } CFW_NW_CONN_STATUS_INFO;
  1710. #define CFW_BLACK_WHITE_PLMN_NUM 5
  1711. typedef struct
  1712. {
  1713. uint8_t nMode; //0:enable white list; 1:enable black lsit; 2: disalbe black white lsit
  1714. uint8_t ltePlmnNum;
  1715. uint8_t ltePlmnList[CFW_BLACK_WHITE_PLMN_NUM * 6];
  1716. uint8_t gsmPlmnNum;
  1717. uint8_t gsmPlmnList[CFW_BLACK_WHITE_PLMN_NUM * 6];
  1718. } CFW_BLACK_WHITE_LIST;
  1719. uint32_t CFW_NwSetBlackWhiteList(CFW_BLACK_WHITE_LIST *pBlackWhiteList, CFW_SIM_ID nSimID);
  1720. #define NW_MAX_FREQ 20
  1721. #ifdef CSG_SUPPORT
  1722. typedef struct
  1723. {
  1724. uint8_t nCellTypeId;
  1725. uint8_t csgStatus;
  1726. uint8_t csgTypeFile;
  1727. uint8_t csgTypeInd;
  1728. uint8_t hnbNameLength;
  1729. uint32_t csgId;
  1730. uint8_t hnbName[NW_MAX_HNBNAME];
  1731. } NW_CSG_CELL_INFO;
  1732. typedef struct
  1733. {
  1734. uint8_t nIndex; //maybe not?
  1735. uint8_t nPlmnNb;
  1736. uint8_t nLteCellNb;
  1737. uint8_t searchMode; /*1:freq scan; 2:csg cell info; other:normal user plmn search*/
  1738. uint8_t nPlmnL[NW_MAX_FREQ * 3];
  1739. uint8_t nRestr[NW_MAX_FREQ];
  1740. uint8_t nRat[NW_MAX_FREQ];
  1741. NW_CSG_CELL_INFO nCellInfo[NW_MAX_FREQ];
  1742. } NW_CSG_LIST_INFO;
  1743. uint32_t CFW_NwGetCsgOperators(uint16_t nUTI, CFW_SIM_ID nSimID);
  1744. uint32_t CFW_NwCSGSetRegistration(uint8_t nOperatorId[6], uint8_t nMode,
  1745. uint8_t nRat, uint32_t nCsgId, uint16_t nUTI, CFW_SIM_ID nSimID);
  1746. uint32_t CFW_NwSetCsgMode(uint8_t nMode, CFW_SIM_ID nSimID);
  1747. uint32_t CFW_NwGetCsgMode(CFW_SIM_ID nSimID);
  1748. #endif
  1749. typedef struct
  1750. {
  1751. uint32_t nArfcn;
  1752. uint8_t nTac[2];
  1753. uint16_t nPci;
  1754. int16_t nRSRP;
  1755. int16_t nRSRQ;
  1756. int16_t nRSSI;
  1757. uint16_t nBand;
  1758. uint16_t nSINR;
  1759. uint32_t nCellId;
  1760. uint8_t nPlmnId[3];
  1761. } NW_FREQ_SCAN_CELL_INFO;
  1762. typedef struct
  1763. {
  1764. uint32_t nArfcn;
  1765. uint8_t nLac[2];
  1766. int16_t nRSSI;
  1767. uint16_t nBand;
  1768. uint16_t nCellId[2];
  1769. uint8_t nPlmnId[3];
  1770. uint16_t nBsic;
  1771. } NW_GSM_FREQ_SCAN_CELL_INFO;
  1772. typedef struct
  1773. {
  1774. uint8_t nCount; // 0: LTE 1: GSM
  1775. uint8_t nPlmnNb;
  1776. uint8_t nLteCellNb;
  1777. uint8_t nGsmCellNb;
  1778. uint8_t nPlmnL[NW_MAX_FREQ * 3];
  1779. uint8_t nRestr[NW_MAX_FREQ];
  1780. uint8_t nRat[NW_MAX_FREQ];
  1781. NW_FREQ_SCAN_CELL_INFO *pCellInfo; //nCellInfo[NW_MAX_FREQ]
  1782. NW_GSM_FREQ_SCAN_CELL_INFO *pGsmCell; //nGsmCell[NW_MAX_FREQ]
  1783. uint8_t searchMode; /*1:freq scan; other:normal user plmn search*/
  1784. uint8_t padding[3];
  1785. } NW_FREQ_SCAN_INFO;
  1786. #ifndef CONFIG_QUEC_PROJECT_FEATURE
  1787. typedef struct
  1788. {
  1789. uint32_t nArfcn;
  1790. uint8_t nTac[2];
  1791. uint16_t nPci;
  1792. int16_t nRSRP;
  1793. int16_t nRSRQ;
  1794. int16_t nRSSI;
  1795. uint16_t nBand;
  1796. uint16_t nSINR;
  1797. uint32_t nCellId;
  1798. uint8_t nPlmnId[3];
  1799. } NW_FREQ_SCAN_CELL_ALL_INFO;
  1800. typedef struct
  1801. {
  1802. uint32_t nArfcn;
  1803. uint8_t nLac[2];
  1804. int16_t nRSSI;
  1805. uint16_t nBand;
  1806. uint16_t nCellId[2];
  1807. uint8_t nPlmnId[3];
  1808. uint16_t nBsic;
  1809. } NW_GSM_FREQ_SCAN_CELL_ALL_INFO;
  1810. typedef struct
  1811. {
  1812. uint8_t nCount; // 0: LTE 1: GSM
  1813. uint8_t nPlmnNb;
  1814. uint8_t nLteCellNb;
  1815. uint8_t nGsmCellNb;
  1816. uint8_t nPlmnL[NW_MAX_FREQ * 3];
  1817. uint8_t nRestr[NW_MAX_FREQ];
  1818. uint8_t nRat[NW_MAX_FREQ];
  1819. NW_FREQ_SCAN_CELL_ALL_INFO *pCellInfo; //nCellInfo[NW_MAX_FREQ]
  1820. NW_GSM_FREQ_SCAN_CELL_ALL_INFO *pGsmCell; //nGsmCell[NW_MAX_FREQ]
  1821. uint8_t searchMode; /*1:freq scan; other:normal user plmn search*/
  1822. uint8_t padding[3];
  1823. } NW_FREQ_SCAN_ALL_INFO;
  1824. typedef struct
  1825. {
  1826. uint32_t nArfcn;
  1827. uint8_t nLac[2];
  1828. int16_t nRSSI;
  1829. uint16_t nBand;
  1830. uint16_t nCellId[2];
  1831. uint8_t nPlmnId[3];
  1832. uint16_t nBsic;
  1833. uint8_t c1;
  1834. bool isgprsSupport;
  1835. } NW_GSM_FREQ_SCAN_CELL_ALL_INFO_V2;
  1836. typedef struct
  1837. {
  1838. uint8_t nCount; // 0: LTE 1: GSM
  1839. uint8_t nPlmnNb;
  1840. uint8_t nLteCellNb;
  1841. uint8_t nGsmCellNb;
  1842. uint8_t nPlmnL[NW_MAX_FREQ * 3];
  1843. uint8_t nRestr[NW_MAX_FREQ];
  1844. uint8_t nRat[NW_MAX_FREQ];
  1845. NW_FREQ_SCAN_CELL_ALL_INFO *pCellInfo; //nCellInfo[NW_MAX_FREQ]
  1846. NW_GSM_FREQ_SCAN_CELL_ALL_INFO_V2 *pGsmCell; //nGsmCell[NW_MAX_FREQ]
  1847. uint8_t searchMode; /*1:freq scan; other:normal user plmn search*/
  1848. uint8_t padding[3];
  1849. } NW_FREQ_SCAN_ALL_INFO_V2;
  1850. #endif
  1851. #define CFW_MAX_BLACK_LTE_CELL_NUM 10
  1852. #define CFW_MAX_BLACK_CELL_NUM 10
  1853. typedef struct _CFW_CellDescLte
  1854. {
  1855. uint32_t nFrequency;
  1856. uint16_t nPhyCellId;
  1857. uint16_t nReserved;
  1858. } CFW_CellDescLte;
  1859. typedef struct _CFW_CellDescGsm
  1860. {
  1861. uint16_t nArfcn;
  1862. uint8_t nLai[5];
  1863. uint8_t nBsic;
  1864. } CFW_CellDescGsm;
  1865. typedef struct
  1866. {
  1867. uint16_t nLteBlackCellNum;
  1868. uint16_t nGsmBlackcellnum;
  1869. CFW_CellDescLte nLteBlackCellList[CFW_MAX_BLACK_LTE_CELL_NUM];
  1870. CFW_CellDescGsm nGsmBlackCellList[CFW_MAX_BLACK_CELL_NUM];
  1871. } CFW_BlackCellList;
  1872. typedef struct
  1873. {
  1874. uint8_t nMode;
  1875. uint16_t nLteBlackCellNum;
  1876. uint16_t nGsmBlackcellnum;
  1877. CFW_CellDescLte nLteBlackCellList[CFW_MAX_BLACK_LTE_CELL_NUM];
  1878. CFW_CellDescGsm nGsmBlackCellList[CFW_MAX_BLACK_CELL_NUM];
  1879. } CFW_BlackCellList_V2;
  1880. typedef struct
  1881. {
  1882. uint8_t BlackListCnt;
  1883. uint16_t Seconds;
  1884. } CFW_BlackListCntReq;
  1885. typedef struct
  1886. {
  1887. uint8_t cellNum;
  1888. uint8_t reserved[3];
  1889. CFW_CellDescLte cellList[CFW_MAX_BLACK_LTE_CELL_NUM];
  1890. } CFW_NW_BLKLIST_LTE_INFO;
  1891. uint32_t CFW_GetGsmBlkList(uint16_t nUTI, CFW_SIM_ID nSimID);
  1892. uint32_t CFW_GetLteBlkList(uint16_t nUTI, CFW_SIM_ID nSimID);
  1893. uint32_t CFW_NWSetRat(uint8_t nRat, CFW_SIM_ID nSimID);
  1894. uint8_t CFW_NWGetRat(CFW_SIM_ID nSimID);
  1895. uint32_t CFW_NWSetStackRat(uint8_t nRat, CFW_SIM_ID nSimID);
  1896. uint8_t CFW_NWGetStackRat(CFW_SIM_ID nSimID);
  1897. uint32_t CFW_NwSetNetMode(uint8_t nNetMode, CFW_SIM_ID nSimID);
  1898. uint32_t CFW_NwSetFTA(uint8_t nFta, CFW_SIM_ID nSimID);
  1899. uint8_t CFW_NwGetFTA(CFW_SIM_ID nSimID);
  1900. uint32_t CFW_NwSetAutoAttachFlag(uint8_t flag, CFW_SIM_ID nSimID);
  1901. uint8_t CFW_NwGetAutoAttachFlag(CFW_SIM_ID nSimID);
  1902. uint32_t CFW_NwSetnSecurityUsedFlag(uint8_t nSecurityUsedFlag, CFW_SIM_ID nSimID);
  1903. uint32_t CFW_GprsIpDnsInfo(uint8_t nCid, CFW_SIM_ID nSimID);
  1904. uint32_t CFW_GprsClrIpDns(void);
  1905. uint32_t CFW_NwSetBlackList(CFW_BlackCellList nBlackCellList, CFW_SIM_ID nSimID);
  1906. uint32_t CFW_NwSetBlackList_V2(CFW_BlackCellList_V2 nBlackCellList, CFW_SIM_ID nSimID);
  1907. uint32_t CFW_nvGetBlackListEnable(CFW_SIM_ID nSimID);
  1908. uint8_t CFW_nvSetBlackListEnable(uint8_t BlacklistEnable, CFW_SIM_ID nSimID);
  1909. uint32_t CFW_SetJammingDetectFlag(uint8_t nFlag, CFW_SIM_ID nSimID);
  1910. uint32_t CFW_SetJammingDetectParam(uint8_t nFlag, int16_t nLteThreshold, int16_t nGsmThreshold, CFW_SIM_ID nSimID);
  1911. uint32_t CFW_SetJammingDetectParamEx(uint8_t bEnable, uint8_t detectPeriod, int16_t rssiThresholdLte, int16_t rsrpThreshold, int16_t rsrqThreshold, int16_t rssiThreshold, int16_t snrThreshold, uint16_t minCh, CFW_SIM_ID nSimID);
  1912. uint32_t CFW_NwJammingRssiEnquiry(uint8_t nMode, uint16_t nUTI, CFW_SIM_ID nSimID);
  1913. uint32_t CFW_GetJammingDetect(uint16_t nUTI, CFW_SIM_ID nSimID);
  1914. uint32_t CFW_NwSetBlackListTimer(CFW_BlackListCntReq nBlackListCnt, CFW_SIM_ID nSimID);
  1915. #ifdef CONFIG_SOC_8811
  1916. uint8_t CFW_NwGetAutoAtt(CFW_SIM_ID nSimID);
  1917. #endif
  1918. /*! \brief function retrieves information about, or the count of, available operators.
  1919. The result should be returned through the EV_CFW_NW_GET_AVAIL_OPERATOR_RSP event:
  1920. \rst
  1921. +------+-------+---------------------------------------------------------------------------------------+---------------------------+-------------+
  1922. | UTI | nType | nParam1 | nParam2 | Description |
  1923. +======+=======+=======================================================================================+===========================+=============+
  1924. | nUTI | 0x00 | Pointer to the CFW_NW_OPERATOR_INFO structure array to hold the operator information. | the count array structure | OK |
  1925. +------+-------+---------------------------------------------------------------------------------------+---------------------------+-------------+
  1926. | nUTI | 0xF0 | See below | 0 | Error |
  1927. +------+-------+---------------------------------------------------------------------------------------+---------------------------+-------------+
  1928. \endrst
  1929. when the nType is 0xF0, and the nParam1 indicate the error code which listed below:
  1930. \rst
  1931. +-------------------------------------------+---------------------------------------------------------------------+
  1932. | nParam1 | nParam2 |
  1933. +===========================================+=====================================================================+
  1934. | ERR_CME_OPERATION_TEMPORARILY_NOT_ALLOWED | Network is not provided temporarily, maybe network is initializing. |
  1935. +-------------------------------------------+---------------------------------------------------------------------+
  1936. | ERR_CME_UNKNOWN | Other error. |
  1937. +-------------------------------------------+---------------------------------------------------------------------+
  1938. \endrst
  1939. \param [in] nUTI UTI operation
  1940. \return \a ERR_SUCCESS on success, or error code
  1941. */
  1942. uint32_t CFW_NwGetAvailableOperators(
  1943. uint16_t nUTI,
  1944. CFW_SIM_ID nSimID);
  1945. /*! \brief function retrieves information about, or the count of, available operators.
  1946. The result should be returned through the EV_CFW_NW_GET_AVAIL_OPERATOR_RSP event:
  1947. \rst
  1948. +------+-------+------------------------------------------------------------------------------------------+---------------------------+-------------+
  1949. | UTI | nType | nParam1 | nParam2 | Description |
  1950. +======+=======+==========================================================================================+===========================+=============+
  1951. | nUTI | 0x00 | Pointer to the CFW_NW_OPERATOR_INFO_V2 structure array to hold the operator information. | the count array structure | OK |
  1952. +------+-------+------------------------------------------------------------------------------------------+---------------------------+-------------+
  1953. | nUTI | 0xF0 | See below | 0 | Error |
  1954. +------+-------+------------------------------------------------------------------------------------------+---------------------------+-------------+
  1955. \endrst
  1956. when the nType is 0xF0, and the nParam1 indicate the error code which listed below:
  1957. \rst
  1958. +-------------------------------------------+---------------------------------------------------------------------+
  1959. | nParam1 | nParam2 |
  1960. +===========================================+=====================================================================+
  1961. | ERR_CME_OPERATION_TEMPORARILY_NOT_ALLOWED | Network is not provided temporarily, maybe network is initializing. |
  1962. +-------------------------------------------+---------------------------------------------------------------------+
  1963. | ERR_CME_UNKNOWN | Other error. |
  1964. +-------------------------------------------+---------------------------------------------------------------------+
  1965. \endrst
  1966. \param [in] nUTI UTI operation
  1967. \return \a ERR_SUCCESS on success, or error code
  1968. */
  1969. uint32_t CFW_NwGetAvailableOperators_V2(
  1970. uint16_t nUTI,
  1971. CFW_SIM_ID nSimID);
  1972. /*! \brief function retrieves information about the current operator.
  1973. \param [out] OperatorId Specify the current operator/PLMN (Public Land Mobile Network) compose of MCC (Mobile country code) and MNC (Mobile network code) in BCD format (non-compressed format). If the length of the operator Id is 5,
  1974. the last byte of the operator Id should be 0x0F.
  1975. \param [out] pMode Pointer to UINT8 type to contain the mode which shown below:
  1976. \rst
  1977. +------+------------------------------------------------------------------------------+
  1978. | mode | Description |
  1979. +======+==============================================================================+
  1980. | 0 | automatic mode |
  1981. +------+------------------------------------------------------------------------------+
  1982. | 1 | manual operator selection name field must be present, format can only be = 2 |
  1983. +------+------------------------------------------------------------------------------+
  1984. \endrst
  1985. nOperatorId Point to array of UINT8 type to contain the operator identifier, for example china mobile:
  1986. nOperatorId[0] = 0x04;
  1987. nOperatorId[1] = 0x06;
  1988. nOperatorId[2] = 0x00; nOperatorId[3] = 0x00;
  1989. nOperatorId[4] = 0x00; nOperatorId[5] = 0x0F;
  1990. nOperatorId[0-2] is the MCC, and nOperatorId[3-5] is the MNC
  1991. \return \a ERR_SUCCESS on success, or error code
  1992. */
  1993. uint32_t CFW_NwGetCurrentOperator(
  1994. uint8_t OperatorId[6],
  1995. uint8_t *pMode,
  1996. CFW_SIM_ID nSimID);
  1997. uint32_t CFW_NwGetImei(
  1998. uint16_t nUTI,
  1999. CFW_SIM_ID nSimID);
  2000. uint32_t CFW_SimGetOperatorName(
  2001. uint8_t pOperatorId[6],
  2002. uint16_t nUTI,
  2003. CFW_SIM_ID nSimID);
  2004. /*! \brief function retrieves the selected network carrier signal level and Bit error rate.
  2005. \param [out] pSignalLevel Specify the network the signal level values shown below:
  2006. \rst
  2007. +---------------------+--------------------------------+
  2008. | signal level values | Signal level in dbm |
  2009. +=====================+================================+
  2010. | 0 | -113 dBm or less(<= -113 dBm) |
  2011. +---------------------+--------------------------------+
  2012. | 1 | -111 dBm |
  2013. +---------------------+--------------------------------+
  2014. | 2 to 30 | -109 dBm to -53 dBm |
  2015. +---------------------+--------------------------------+
  2016. | 31 | -51 dBm or greater(>= -51 dBm) |
  2017. +---------------------+--------------------------------+
  2018. | 99 | Unknown or undetectable |
  2019. +---------------------+--------------------------------+
  2020. \endrst
  2021. \param [out] pBitError Specify the Bit error rate shown below:
  2022. \rst
  2023. +----------------+-------------------------------+
  2024. | Bit error rate | Meaning |
  2025. +================+===============================+
  2026. | 0..7 | -113 dBm or less(<= -113 dBm) |
  2027. +----------------+-------------------------------+
  2028. | 99 | -111 dBm |
  2029. +----------------+-------------------------------+
  2030. \endrst
  2031. \return \a ERR_SUCCESS on success, or error code
  2032. */
  2033. uint32_t CFW_NwGetSignalQuality(
  2034. uint8_t *pSignalLevel,
  2035. uint8_t *pBitError,
  2036. CFW_SIM_ID nSimID);
  2037. uint32_t CFW_NwGetLteSignalQuality(
  2038. uint8_t *pSignalLevel,
  2039. uint8_t *pBitError,
  2040. CFW_SIM_ID nSimID);
  2041. uint32_t CFW_NwGetQualReport(
  2042. CFW_NW_QUAL_INFO *pQualReport,
  2043. CFW_SIM_ID nSimID);
  2044. /*! \brief function retrieves the status of GSM network.
  2045. \param [out] pStatusInfo Pointer to CFW_NW_STATUS_INFO structure to contain the network status information.
  2046. \param [in] nSimID SIM ID
  2047. \return \a ERR_SUCCESS on success, or error code
  2048. */
  2049. uint32_t CFW_NwGetStatus(
  2050. CFW_NW_STATUS_INFO *pStatusInfo,
  2051. CFW_SIM_ID nSimID);
  2052. #define NW_SET_AUTO_RAT 0xFF
  2053. /*! \brief function use to choose whether the GSM network operator is to be selected automatically or manually.
  2054. The result should be returned through the EV_CFW_NW_SET_REGISTRATION_RSP event:
  2055. \rst
  2056. +------+-------+-----------+-----------+-----------------------------------+
  2057. | UTI | nType | nParam1 | nParam2 | Description |
  2058. +======+=======+===========+===========+===================================+
  2059. | nUTI | 0x00 | See below | see below | this function perform completely. |
  2060. +------+-------+-----------+-----------+-----------------------------------+
  2061. | nUTI | 0xF0 | See below | see below | Error |
  2062. +------+-------+-----------+-----------+-----------------------------------+
  2063. \endrst
  2064. nParam1: Specify the operator /PLMN (Public Land Mobile Network) compose of MCC (Mobile country code) and MNC (Mobile network code) in BCD format (non-compressed format).
  2065. If the length of the operator Id is 5, the last byte of the operator Id should be 0x0F.
  2066. nParam2: Pointer to UINT8 type to contain the mode which shown below:
  2067. \rst
  2068. +-----------------------+------------------------------------------------------------------------------+
  2069. | mode | Description |
  2070. +=======================+==============================================================================+
  2071. | CFW_NW_AUTOMATIC_MODE | automatic mode |
  2072. +-----------------------+------------------------------------------------------------------------------+
  2073. | CFW_NW_MANUAL_MODE | manual operator selection name field must be present, format can only be = 2 |
  2074. +-----------------------+------------------------------------------------------------------------------+
  2075. \endrst
  2076. when the nType is 0xF0, and the nParam1 indicate the error code which listed below:
  2077. \rst
  2078. +-------------------------------------------------+------------------------------------------+
  2079. | Param1 | Description |
  2080. +=================================================+==========================================+
  2081. | ERR_CME_OPERATION_TEMPORARILY_NOT_ALLOWED | Network is not provided temporarily. |
  2082. +-------------------------------------------------+------------------------------------------+
  2083. | ERR_CME_NO_NETWORK_SERVICE | no network service. |
  2084. +-------------------------------------------------+------------------------------------------+
  2085. | ERR_CME_MEMORY_NOT_ALLOWED_EMERGENCY_CALLS_ONLY | Network not allowed emergency calls only |
  2086. +-------------------------------------------------+------------------------------------------+
  2087. | ERR_CME_UNKNOWN | Other error. |
  2088. +-------------------------------------------------+------------------------------------------+
  2089. \endrst
  2090. \param [in] nOperatorId Specify the identifier of the network operator to register, this parameter should be not terminated with zero and the size of operator id should be 6 bytes. This parameter can be ignored when mode=0,
  2091. in this case this function don't care this parameter at all.
  2092. \param [in] nMode Specify the GSM network registration mode to select which shown below:
  2093. \param [in] nRat The rat LTE or GSM
  2094. \param [in] nUTI UTI operation
  2095. \param [in] nSimID SIM ID
  2096. \return \a ERR_SUCCESS on success, or error code
  2097. */
  2098. uint32_t CFW_NwSetRegistration(
  2099. uint8_t nOperatorId[6],
  2100. uint8_t nMode,
  2101. uint8_t nRat,
  2102. uint16_t nUTI,
  2103. CFW_SIM_ID nSimID);
  2104. typedef enum
  2105. {
  2106. CFW_ALL_DETACH = 0x00, ///< Detach PS and Detach CS
  2107. CFW_ALL_ATTACH, ///< Doing all attach (CS and PS)
  2108. CFW_PS_ATTACH, ///< PS attach
  2109. CFW_PS_DETACH, ///< PS detach
  2110. CFW_INIT_STATE = 0xffffffff ///didn't attach and detach
  2111. } CFW_ATT_DETACH_STATUS;
  2112. /*! \brief function manually deregister from network and remain unregistered until mode 0,1,4 is selected.
  2113. The result should be returned through the EV_CFW_NW_DEREGISTER_RSP event:
  2114. \rst
  2115. +------+-------+------------+---------+-------------+
  2116. | UTI | nType | nParam1 | nParam2 | Description |
  2117. +======+=======+============+=========+=============+
  2118. | nUTI | 0x00 | 0 | 0 | OK |
  2119. +------+-------+------------+---------+-------------+
  2120. | nUTI | 0xF0 | Error code | 0 | Error |
  2121. +------+-------+------------+---------+-------------+
  2122. \endrst
  2123. \param [in] nUTI UTI operation
  2124. \param [in] nSimID SIM ID
  2125. \return \a ERR_SUCCESS on success, or error code
  2126. */
  2127. uint32_t CFW_NwDeRegister(
  2128. uint16_t nUTI,
  2129. CFW_SIM_ID nSimID);
  2130. uint32_t CFW_DetachCSAndPS(
  2131. uint16_t nUTI,
  2132. CFW_SIM_ID nSimID);
  2133. uint32_t CFW_AttachCSAndPS(
  2134. uint16_t nUTI,
  2135. CFW_SIM_ID nSimID);
  2136. uint32_t CFW_NwGetAllDetach(
  2137. uint8_t *nAttDetach,
  2138. CFW_SIM_ID nSimID);
  2139. uint32_t CFW_NwGetHNBName(
  2140. uint8_t *pLength,
  2141. uint8_t *pHNBName,
  2142. CFW_SIM_ID nSimID);
  2143. typedef enum
  2144. {
  2145. CFW_DISABLE_COMM = 0x00, ///< don't start
  2146. CFW_ENABLE_COMM, ///< start stack
  2147. CFW_CHECK_COMM,
  2148. CFW_COMM_MODE_ENUM_FILL = 0x7fffffff
  2149. } CFW_COMM_MODE;
  2150. //nMode: 0 : CFW_DISABLE_COMM; 1: CFW_ENABLE_COMM; 2: CFW_CHECK_COMM
  2151. uint32_t CFW_SetComm(
  2152. CFW_COMM_MODE nMode,
  2153. uint8_t nStorageFlag,
  2154. uint16_t nUTI,
  2155. CFW_SIM_ID nSimID);
  2156. uint32_t CFW_GetComm(
  2157. CFW_COMM_MODE *pMode,
  2158. CFW_SIM_ID nSimID);
  2159. uint32_t CFW_CfgNwSetFM(
  2160. CFW_COMM_MODE bMode,
  2161. CFW_SIM_ID nSimID);
  2162. uint32_t CFW_CfgNwSetCgclassType(
  2163. uint8_t nCgclassType,
  2164. CFW_SIM_ID nSimID);
  2165. uint32_t CFW_CfgNwGetCgclassType(
  2166. uint8_t *nCgclassType,
  2167. CFW_SIM_ID nSimID);
  2168. /*! \brief function changes the frequency band.
  2169. The result should be returned through the EV_CFW_NW_SET_BAND_RSP event which shown below:
  2170. \rst
  2171. +-------+-----------+---------+-------------+
  2172. | nType | nParam1 | nParam2 | Description |
  2173. +=======+===========+=========+=============+
  2174. | 0x00 | nBand | 0 | OK |
  2175. +-------+-----------+---------+-------------+
  2176. | 0xF0 | see below | 0 | Error |
  2177. +-------+-----------+---------+-------------+
  2178. \endrst
  2179. When the nType is 0xF0, and the nParam1 indicate the error code which listed below:
  2180. \rst
  2181. +-------------------------------------------------+------------------------------------------+
  2182. | Param1 | Description |
  2183. +=================================================+==========================================+
  2184. | ERR_CME_OPERATION_TEMPORARILY_NOT_ALLOWED | Network is not provided temporarily. |
  2185. +-------------------------------------------------+------------------------------------------+
  2186. | ERR_CME_NO_NETWORK_SERVICE | no network service. |
  2187. +-------------------------------------------------+------------------------------------------+
  2188. | ERR_CME_MEMORY_NOT_ALLOWED_EMERGENCY_CALLS_ONLY | Network not allowed emergency calls only |
  2189. +-------------------------------------------------+------------------------------------------+
  2190. | ERR_CME_UNKNOWN | Other error. |
  2191. +-------------------------------------------------+------------------------------------------+
  2192. \endrst
  2193. \param [in] nBand Specify the frequency band to active.
  2194. \param [in] nUTI UTI operation
  2195. \param [in] nSimID SIM ID
  2196. \return \a ERR_SUCCESS on success, or error code
  2197. */
  2198. uint32_t CFW_NwSetFrequencyBand(
  2199. uint8_t nBand,
  2200. uint16_t nUTI,
  2201. CFW_SIM_ID nSimID);
  2202. /*! \brief function abort the construction of the list of surrounding PLMNs retrieved.
  2203. The result should be returned through the EV_CFW_NW_ABORT_LIST_OPERATORS_RSP event:
  2204. \rst
  2205. +------+-------+------------+---------+-------------+
  2206. | nUTI | nType | nParam1 | nParam2 | Description |
  2207. +======+=======+============+=========+=============+
  2208. | nUTI | 0x00 | 0 | 0 | OK |
  2209. +------+-------+------------+---------+-------------+
  2210. | nUTI | 0xF0 | ERROR code | 0 | Error |
  2211. +------+-------+------------+---------+-------------+
  2212. \endrst
  2213. \param [in] nUTI UTI operation
  2214. \param [in] nSimID SIM ID
  2215. \return
  2216. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2217. \rst
  2218. +-------------------------------------------------+-----------------------------------------------------------+
  2219. | Param1 | Description |
  2220. +=================================================+===========================================================+
  2221. | ERR_CFW_UTI_IS_BUSY | The UTI is busy, maybe the UTI is used by other instance. |
  2222. +-------------------------------------------------+-----------------------------------------------------------+
  2223. | ERR_CME_MEMORY_NOT_ALLOWED_EMERGENCY_CALLS_ONLY | Network not allowed emergency calls only |
  2224. +-------------------------------------------------+-----------------------------------------------------------+
  2225. | ERR_CME_UNKNOWN | Other error. |
  2226. +-------------------------------------------------+-----------------------------------------------------------+
  2227. \endrst
  2228. */
  2229. uint32_t CFW_NwAbortListOperators(
  2230. uint16_t nUTI,
  2231. CFW_SIM_ID nSimID);
  2232. bool CFW_GetNWTimerOutFlag(CFW_SIM_ID nSimID);
  2233. void CFW_SetNWTimerOutFlag(bool bClear, CFW_SIM_ID nSimID);
  2234. //Please use these two interfaces together;first call ScanInfo,then get call ScanEnd.
  2235. //Please use the same UTI.
  2236. uint32_t CFW_GetFreqScanInfo(uint16_t nUTI, CFW_SIM_ID nSimID);
  2237. uint32_t CFW_GetFreqScanEnd(uint16_t nUTI, CFW_SIM_ID nSimID);
  2238. uint32_t CFW_GetFreqScanAllInfo(uint16_t nUTI, CFW_SIM_ID nSimID);
  2239. uint32_t CFW_NwSetCSMode(uint8_t nMode, CFW_SIM_ID nSimID);
  2240. #define CFW_NW_BAND_GSM_450 (1 << 0)
  2241. #define CFW_NW_BAND_GSM_480 (1 << 1)
  2242. #define CFW_NW_BAND_GSM_900P (1 << 2)
  2243. #define CFW_NW_BAND_GSM_900E (1 << 3)
  2244. #define CFW_NW_BAND_GSM_900R (1 << 4)
  2245. #define CFW_NW_BAND_GSM_850 (1 << 5)
  2246. #define CFW_NW_BAND_DCS_1800 (1 << 6)
  2247. #define CFW_NW_BAND_PCS_1900 (1 << 7)
  2248. //
  2249. // CM Service
  2250. //
  2251. #define CFW_CM_MODE_VOICE 0
  2252. #define CFW_CM_MODE_DATA 1
  2253. #define CFW_CM_MODE_FAX 2
  2254. //Call direction
  2255. #define CFW_DIRECTION_MOBILE_ORIGINATED 0
  2256. #define CFW_DIRECTION_MOBILE_TERMINATED 1
  2257. //Call state
  2258. #define CFW_CM_STATUS_ACTIVE 0
  2259. #define CFW_CM_STATUS_HELD 1
  2260. #define CFW_CM_STATUS_DIALING 2 ///< MO CALL)
  2261. #define CFW_CM_STATUS_ALERTING 3 ///< (MO CALL)
  2262. #define CFW_CM_STATUS_INCOMING 4 ///< (MT CALL)
  2263. #define CFW_CM_STATUS_WAITING 5 ///< (MT call)
  2264. #define CFW_CM_STATUS_RELEASED 7
  2265. //#ifdef CFW_VOLTE_SUPPORT //quectel modify
  2266. #define CFW_CM_STATUS_HANDSHAKE 8
  2267. //#endif //quectel modify
  2268. #define TEL_NUMBER_STRING_MAX_LEN 30
  2269. #define TEL_NUMBER_STRING_MAX_LEN_EX 30
  2270. typedef struct _CFW_SPEECH_CALL_IND
  2271. {
  2272. CFW_TELNUMBER TelNumber;
  2273. uint8_t nCode;
  2274. uint8_t nCLIValidity;
  2275. uint8_t nDisplayType;
  2276. uint8_t nIndex;
  2277. uint8_t calling_uri[TEL_NUMBER_STRING_MAX_LEN + 1];
  2278. } CFW_SPEECH_CALL_IND;
  2279. typedef struct _CFW_CC_CURRENT_CALL_INFO
  2280. {
  2281. CFW_TELNUMBER dialNumber;
  2282. bool multiparty;
  2283. uint8_t idx;
  2284. uint8_t direction;
  2285. uint8_t status;
  2286. uint8_t mode;
  2287. uint8_t calling_uri[TEL_NUMBER_STRING_MAX_LEN + 1];
  2288. uint8_t padding[3];
  2289. } CFW_CC_CURRENT_CALL_INFO;
  2290. typedef struct _CFW_CC_CURRENT_CALL_INFO_V2
  2291. {
  2292. CFW_TELNUMBER dialNumber;
  2293. bool multiparty;
  2294. uint8_t idx;
  2295. uint8_t direction;
  2296. uint8_t status;
  2297. uint8_t mode;
  2298. uint8_t calling_uri[TEL_NUMBER_STRING_MAX_LEN_EX + 1];
  2299. uint8_t padding[3];
  2300. } CFW_CC_CURRENT_CALL_INFO_V2;
  2301. //Remove CPP_KEYWORD_SUPPORT by lixp for MMI compilation issue at 20090512.
  2302. typedef struct _CFW_SS_QUERY_CALLFORWARDING_RSP
  2303. {
  2304. CFW_TELNUMBER nNumber;
  2305. uint8_t nStatus;
  2306. uint8_t nClass;
  2307. uint8_t nReason;
  2308. uint8_t nTime;
  2309. } CFW_SS_QUERY_CALLFORWARDING_RSP;
  2310. typedef struct _CFW_SS_SET_CALLFORWARDING_INFO
  2311. {
  2312. uint8_t nReason;
  2313. uint8_t nMode;
  2314. uint8_t nClass;
  2315. uint8_t nTime;
  2316. CFW_DIALNUMBER_V2 nNumber;
  2317. } CFW_SS_SET_CALLFORWARDING_INFO;
  2318. typedef struct _CFW_SS_SET_CALLFORWARDING_RSP_INFO
  2319. {
  2320. uint8_t nReason;
  2321. uint8_t nMode;
  2322. uint8_t nClass;
  2323. uint8_t nTime;
  2324. CFW_DIALNUMBER nNumber;
  2325. } CFW_SS_SET_CALLFORWARDING_RSP_INFO;
  2326. /*! \brief The function is used to accept an incoming voice call.
  2327. The result should be returned through the following \a EV_CFW_CC_ACCEPT_SPEECH_CALL_RSP event:
  2328. \rst
  2329. +------+-------+---------------------+----------------------------------------------+---------------+
  2330. | UTI | nType | nParam1 | nParam2 | Description |
  2331. +======+=======+=====================+==============================================+===============+
  2332. | nUTI | 0x0F | 0 | 0 | OK |
  2333. +------+-------+---------------------+----------------------------------------------+---------------+
  2334. | | | | HIUINT16(nParam2) = 0; | |
  2335. | nUTI | 0x10 | ranging from 1 to 7 | LOUINT16(nParam2)= | MO Release |
  2336. | | | | CFW_CC_CAUSE_RECOVERY_ON_TIMER_EXPIRY | (Time expire) |
  2337. +------+-------+---------------------+----------------------------------------------+---------------+
  2338. | | | | HIUINT16(nParam2)=Call identification number | |
  2339. | | | | LOUINT16(nParam2)= | |
  2340. | nUTI | 0xF0 | Network cause | CFW_CC_CAUSE_NORMAL_RELEASE or | Error |
  2341. | | | | CFW_CC_CAUSE_LOW_LAYER_FAIL | |
  2342. +------+-------+---------------------+----------------------------------------------+---------------+
  2343. \endrst
  2344. \param [in] nSimID SIM ID
  2345. \return
  2346. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2347. \rst
  2348. +-------------------------------------------+--------------------------------------+
  2349. | Error Code | Description |
  2350. +===========================================+======================================+
  2351. | ERR_CME_OPERATION_TEMPORARILY_NOT_ALLOWED | There is no any incoming voice call. |
  2352. +-------------------------------------------+--------------------------------------+
  2353. | ERR_CME_MEMORY_FULL | No any more memory to use. |
  2354. +-------------------------------------------+--------------------------------------+
  2355. \endrst
  2356. */
  2357. uint32_t CFW_CcAcceptSpeechCall(
  2358. CFW_SIM_ID nSimId);
  2359. /*! \brief The function is as well as CFW_CcAcceptSpeechCallEx.
  2360. */
  2361. uint32_t CFW_CcAcceptSpeechCallEx(
  2362. CFW_SIM_ID nSimId);
  2363. /*! \brief The function is used to get the status of current calls.
  2364. \param [in] nSimID SIM ID
  2365. \return \a CC_STATE
  2366. */
  2367. uint32_t CFW_CcGetCallStatus(
  2368. CFW_SIM_ID nSimId);
  2369. /*! \brief The function is used to get the number of current calls.
  2370. \param [in] nSimID SIM ID
  2371. \return \a number of current calls
  2372. */
  2373. uint8_t CFW_GetCcCount(
  2374. CFW_SIM_ID nSimID);
  2375. /*! \brief The function Gets a list of current calls or the count of them.
  2376. \param [out] CallInfo[7] Specifies the CFW_CC_CURRENT_CALL_INFO structure array that holds the current speech call information.
  2377. \param [out] pCnt Point to uint8_t type to retrieve the count of CallInfo.
  2378. \param [in] nSimID SIM ID
  2379. \return \a ERR_SUCCESS on success, or error code
  2380. */
  2381. uint32_t CFW_CcGetCurrentCall(
  2382. CFW_CC_CURRENT_CALL_INFO CallInfo[7],
  2383. uint8_t *pCnt,
  2384. CFW_SIM_ID nSimId);
  2385. /*! \brief The function Gets a list of current calls or the count of them.
  2386. \param [out] CallInfo[7] Specifies the CFW_CC_CURRENT_CALL_INFO structure array that holds the current speech call information.
  2387. \param [out] pCnt Point to uint8_t type to retrieve the count of CallInfo.
  2388. \param [in] nSimID SIM ID
  2389. \return \a ERR_SUCCESS on success, or error code
  2390. */
  2391. uint32_t CFW_CcGetCurrentCallV2(
  2392. CFW_CC_CURRENT_CALL_INFO_V2 CallInfo[7],
  2393. uint8_t *pCnt,
  2394. CFW_SIM_ID nSimId);
  2395. /*! \brief The function places all active calls, if any, on hold and accept another (incoming, waiting, or held) call, if any.
  2396. The result should be returned asynchronously through the EV_CFW_CC_CALL_HOLD_MULTIPARTY_RSP event:
  2397. \rst
  2398. +------+-------+-------------------+-------------------+-----------------+
  2399. | UTI | nType | nParam1 | nParam2 | Description |
  2400. +======+=======+===================+===================+=================+
  2401. | | | | | Perform |
  2402. | nUTI | 0x00 | 1 to 7. | 0 | successfully. |
  2403. +------+-------+-------------------+-------------------+-----------------+
  2404. | | | | | |
  2405. | nUTI | 0x01 | 1 to 7. | 0 | release call |
  2406. | | | | | successfully. |
  2407. +------+-------+-------------------+-------------------+-----------------+
  2408. | | | | | anwser call |
  2409. | nUTI | 0x0F | 1 to 7. | 0 | successfully. |
  2410. +------+-------+-------------------+-------------------+-----------------+
  2411. | | | | | MO Release(i.e. |
  2412. | nUTI | 0x10 | 1 to 7. | 0 | Time expire) |
  2413. +------+-------+-------------------+-------------------+-----------------+
  2414. | nUTI | 0xF0 | Network Error cod | CC local error | Error |
  2415. +------+-------+-------------------+-------------------+-----------------+
  2416. | | | | HIUINT16=number | |
  2417. | | | HIUINT16=ss_code | HIUINT8(LOUINT16) | |
  2418. | nUTI | 0xF1 | LOUINT16= | =problemTag | Error |
  2419. | | | ss_operations | LOUINT8(LOUINT16) | |
  2420. | | | | =CRSS Error | |
  2421. +------+-------+-------------------+-------------------+-----------------+
  2422. \endrst
  2423. the EV_CFW_CC_CALL_SWAP_RSP event:
  2424. \rst
  2425. +------+-------+---------+---------+---------------+
  2426. | UTI | nType | nParam1 | nParam2 | Description |
  2427. +======+=======+=========+=========+===============+
  2428. | | | | | Perform |
  2429. | nUTI | 0x00 | 1 to 7. | 0 | successfully. |
  2430. +------+-------+---------+---------+---------------+
  2431. \endrst
  2432. \param [in] nCmd Specify the command which you can select a value below:
  2433. \rst
  2434. +------------------------+--------------------------------------------------------------+
  2435. | nCmd, nIndex | Description |
  2436. +========================+==============================================================+
  2437. | | Terminate all held calls;dor set User Determined User Busy |
  2438. | nCmd=0, nIndex=0xFF | for a waiting call,reject the waiting call |
  2439. +------------------------+--------------------------------------------------------------+
  2440. | | Terminate all active calls (if any) and accept the other |
  2441. | nCmd=1, nIndex=0xFF | call(waiting call or held call).This command isn't available |
  2442. | | when there is only one incoming call |
  2443. +------------------------+--------------------------------------------------------------+
  2444. | nCmd=1, nIndex=x(1-7) | Terminate the call specified by nIndex (nIndex= 1-7). |
  2445. +------------------------+--------------------------------------------------------------+
  2446. | | Place all active calls on hold(if any)and accept the |
  2447. | nCmd=2, nIndex=0xFF | other call (waiting call or held call) as the active |
  2448. | | the waiting call will be accepted as active call at first). |
  2449. +------------------------+--------------------------------------------------------------+
  2450. | | Place all active calls except call nIndex(nIndex= 1-7) on |
  2451. | nCmd= 2, nIndex=x(1-7) | hold. |
  2452. +------------------------+--------------------------------------------------------------+
  2453. | nCmd=3, nIndex=0xFF | Add the held call to the active calls. |
  2454. +------------------------+--------------------------------------------------------------+
  2455. \endrst
  2456. \param [in] nIndex Specify the associated parameter see nCmd above.
  2457. \param [in] nSimId SIM ID
  2458. \return
  2459. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2460. \rst
  2461. +-------------------------------------------+---------------------------------+
  2462. | Error Code | Description |
  2463. +===========================================+=================================+
  2464. | ERR_CME_OPERATION_TEMPORARILY_NOT_ALLOWED | There is no voice call. |
  2465. +-------------------------------------------+---------------------------------+
  2466. | ERR_CFW_INVALID_PARAMETER | The input parameter is invalid. |
  2467. +-------------------------------------------+---------------------------------+
  2468. \endrst
  2469. */
  2470. uint32_t CFW_CcCallHoldMultiparty(
  2471. uint8_t nCmd,
  2472. uint8_t nIndex,
  2473. CFW_SIM_ID nSimId);
  2474. uint32_t CFW_CcCallHoldMultiparty_V2(uint16_t nUTI, uint8_t nCmd, uint8_t nIndex, CFW_SIM_ID nSimId);
  2475. #ifdef LTE_SUPPORT
  2476. /*! \brief The function disconnects the index x call in progress, such as voice calls or CSD data calls.
  2477. The result should be returned asynchronously through the EV_CFW_CC_RELEASE_CALL_RSP event:
  2478. \rst
  2479. +------+---------+-------------------+-------------------+----------------------+
  2480. | UTI | nType | nParam1 | nParam2 | Description |
  2481. +======+=========+===================+===================+======================+
  2482. | | | | | |
  2483. | nUTI | 0x10/30 | 1 to 7. | Network Error cod | OK |
  2484. +------+---------+-------------------+-------------------+----------------------+
  2485. | nUTI | 0x20 | 0 | 0 | When no any call, |
  2486. | | | | | this function called |
  2487. +------+---------+-------------------+-------------------+----------------------+
  2488. | | | | HIUINT16=number | |
  2489. | nUTI | 0xF0 | Network Error cod | LOUINT16 = | Error |
  2490. | | | | network casue | |
  2491. +------+---------+-------------------+-------------------+----------------------+
  2492. \endrst
  2493. \param [in] nIndex the index call
  2494. \param [in] nSimID SIM ID
  2495. \return
  2496. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2497. \rst
  2498. +-------------------------------------------+-------------------------------------+
  2499. | Error Code | Description |
  2500. +===========================================+=====================================+
  2501. | ERR_CME_OPERATION_TEMPORARILY_NOT_ALLOWED | Temporarily operate is not allowed. |
  2502. +-------------------------------------------+-------------------------------------+
  2503. \endrst
  2504. */
  2505. uint32_t CFW_CcReleaseCallX(
  2506. uint8_t nIndex,
  2507. CFW_SIM_ID nSimId);
  2508. uint32_t CFW_CcReleaseCallX_V2(
  2509. uint16_t nUTI,
  2510. uint8_t nIndex,
  2511. uint8_t cause,
  2512. CFW_SIM_ID nSimId);
  2513. #endif
  2514. /*! \brief The function initiates a voice call.
  2515. The result should be returned asynchronously through the EV_CFW_CC_INITIATE_SPEECH_CALL_RSP event:
  2516. \rst
  2517. +------+-------+------------------------+----------------------+------------------+
  2518. | UTI | nType | nParam1 | nParam2 | Description |
  2519. +======+=======+========================+======================+==================+
  2520. | | | | | call connect |
  2521. | nUTI | 0x00 | 0 | 0 | successfully. |
  2522. +------+-------+------------------------+----------------------+------------------+
  2523. | | | point CFW_TELNUMBER to | | |
  2524. | nUTI | 0x01 | hold the telephone | 0 | call connect |
  2525. | | | number | | successfully. |
  2526. +------+-------+------------------------+----------------------+------------------+
  2527. | | | | HIUINT16=0 | Error MO Release |
  2528. | nUTI | 0x10 | 1 to 7. | LOUINT16=Network err | |
  2529. +------+-------+------------------------+----------------------+------------------+
  2530. | | | | HIUINT16=cc number | |
  2531. | nUTI | 0xF0 | Network Error cod | LOUINT16=local err | Error |
  2532. +------+-------+------------------------+----------------------+------------------+
  2533. \endrst
  2534. \param [in] pDialNumber Pointer to the CFW_DIALNUMBER structure to dial
  2535. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  2536. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  2537. module. This parameter should be less than 255 for all upper layer application.
  2538. \param [in] nSimID SIM ID
  2539. \return
  2540. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2541. \rst
  2542. +------------------------------+------------------------------------------------+
  2543. | Error Code | Description |
  2544. +==============================+================================================+
  2545. | ERR_CFW_INVALID_PARAMETER | The input parameter is NULL |
  2546. +------------------------------+------------------------------------------------+
  2547. | ERR_CME_DIAL_STRING_TOO_LONG | The input dial number string is tool long(>40) |
  2548. +------------------------------+------------------------------------------------+
  2549. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system. |
  2550. +------------------------------+------------------------------------------------+
  2551. | ERR_CME_MEMORY_FULL | No any more memory to use. |
  2552. +------------------------------+------------------------------------------------+
  2553. \endrst
  2554. */
  2555. uint32_t CFW_CcInitiateSpeechCall(
  2556. CFW_DIALNUMBER *pDialNumber,
  2557. uint16_t nUTI,
  2558. CFW_SIM_ID nSimId);
  2559. /*! \brief The function initiates a voice call.
  2560. The result should be returned asynchronously through the EV_CFW_CC_INITIATE_SPEECH_CALL_RSP event:
  2561. \rst
  2562. +------+-------+------------------------+----------------------+------------------+
  2563. | UTI | nType | nParam1 | nParam2 | Description |
  2564. +======+=======+========================+======================+==================+
  2565. | | | | | call connect |
  2566. | nUTI | 0x00 | 0 | 0 | successfully. |
  2567. +------+-------+------------------------+----------------------+------------------+
  2568. | | | point CFW_TELNUMBER to | | |
  2569. | nUTI | 0x01 | hold the telephone | 0 | call connect |
  2570. | | | number | | successfully. |
  2571. +------+-------+------------------------+----------------------+------------------+
  2572. | | | | HIUINT16=0 | Error MO Release |
  2573. | nUTI | 0x10 | 1 to 7. | LOUINT16=Network err | |
  2574. +------+-------+------------------------+----------------------+------------------+
  2575. | | | | HIUINT16=cc number | |
  2576. | nUTI | 0xF0 | Network Error cod | LOUINT16=local err | Error |
  2577. +------+-------+------------------------+----------------------+------------------+
  2578. \endrst
  2579. \param [in] pDialNumber Pointer to the CFW_DIALNUMBER_V2 structure to dial
  2580. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  2581. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  2582. module. This parameter should be less than 255 for all upper layer application.
  2583. \param [in] nSimID SIM ID
  2584. \return
  2585. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2586. \rst
  2587. +------------------------------+------------------------------------------------+
  2588. | Error Code | Description |
  2589. +==============================+================================================+
  2590. | ERR_CFW_INVALID_PARAMETER | The input parameter is NULL |
  2591. +------------------------------+------------------------------------------------+
  2592. | ERR_CME_DIAL_STRING_TOO_LONG | The input dial number string is tool long(>40) |
  2593. +------------------------------+------------------------------------------------+
  2594. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system. |
  2595. +------------------------------+------------------------------------------------+
  2596. | ERR_CME_MEMORY_FULL | No any more memory to use. |
  2597. +------------------------------+------------------------------------------------+
  2598. \endrst
  2599. */
  2600. uint32_t CFW_CcInitiateSpeechCall_V2(
  2601. CFW_DIALNUMBER_V2 *pDialNumber,
  2602. uint16_t nUTI,
  2603. CFW_SIM_ID nSimId);
  2604. /*! \brief The function initiates a voice call.
  2605. The result should be returned asynchronously through the EV_CFW_CC_INITIATE_SPEECH_CALL_RSP event:
  2606. \rst
  2607. +------+-------+------------------------+----------------------+------------------+
  2608. | UTI | nType | nParam1 | nParam2 | Description |
  2609. +======+=======+========================+======================+==================+
  2610. | | | | | call connect |
  2611. | nUTI | 0x00 | 0 | 0 | successfully. |
  2612. +------+-------+------------------------+----------------------+------------------+
  2613. | | | point CFW_TELNUMBER to | | |
  2614. | nUTI | 0x01 | hold the telephone | 0 | call connect |
  2615. | | | number | | successfully. |
  2616. +------+-------+------------------------+----------------------+------------------+
  2617. | | | | HIUINT16=0 | Error MO Release |
  2618. | nUTI | 0x10 | 1 to 7. | LOUINT16=Network err | |
  2619. +------+-------+------------------------+----------------------+------------------+
  2620. | | | | HIUINT16=cc number | |
  2621. | nUTI | 0xF0 | Network Error cod | LOUINT16=local err | Error |
  2622. +------+-------+------------------------+----------------------+------------------+
  2623. \endrst
  2624. \param [in] pDialNumber Pointer to the CFW_DIALNUMBER structure to dial
  2625. \param [out] pIndex the index of the setup call
  2626. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  2627. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  2628. module. This parameter should be less than 255 for all upper layer application.
  2629. \param [in] nSimID SIM ID
  2630. \return
  2631. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2632. \rst
  2633. +------------------------------+------------------------------------------------+
  2634. | Error Code | Description |
  2635. +==============================+================================================+
  2636. | ERR_CFW_INVALID_PARAMETER | The input parameter is NULL |
  2637. +------------------------------+------------------------------------------------+
  2638. | ERR_CME_DIAL_STRING_TOO_LONG | The input dial number string is tool long(>40) |
  2639. +------------------------------+------------------------------------------------+
  2640. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system. |
  2641. +------------------------------+------------------------------------------------+
  2642. | ERR_CME_MEMORY_FULL | No any more memory to use. |
  2643. +------------------------------+------------------------------------------------+
  2644. \endrst
  2645. */
  2646. uint32_t CFW_CcInitiateSpeechCallEx(
  2647. CFW_DIALNUMBER *pDialNumber,
  2648. uint8_t *pIndex,
  2649. uint16_t nUTI,
  2650. CFW_SIM_ID nSimId);
  2651. /*! \brief The function initiates a voice call.
  2652. The result should be returned asynchronously through the EV_CFW_CC_INITIATE_SPEECH_CALL_RSP event:
  2653. \rst
  2654. +------+-------+------------------------+----------------------+------------------+
  2655. | UTI | nType | nParam1 | nParam2 | Description |
  2656. +======+=======+========================+======================+==================+
  2657. | | | | | call connect |
  2658. | nUTI | 0x00 | 0 | 0 | successfully. |
  2659. +------+-------+------------------------+----------------------+------------------+
  2660. | | | point CFW_TELNUMBER to | | |
  2661. | nUTI | 0x01 | hold the telephone | 0 | call connect |
  2662. | | | number | | successfully. |
  2663. +------+-------+------------------------+----------------------+------------------+
  2664. | | | | HIUINT16=0 | Error MO Release |
  2665. | nUTI | 0x10 | 1 to 7. | LOUINT16=Network err | |
  2666. +------+-------+------------------------+----------------------+------------------+
  2667. | | | | HIUINT16=cc number | |
  2668. | nUTI | 0xF0 | Network Error cod | LOUINT16=local err | Error |
  2669. +------+-------+------------------------+----------------------+------------------+
  2670. \endrst
  2671. \param [in] pDialNumber Pointer to the CFW_DIALNUMBER_V2 structure to dial
  2672. \param [out] pIndex the index of the setup call
  2673. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  2674. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  2675. module. This parameter should be less than 255 for all upper layer application.
  2676. \param [in] nSimID SIM ID
  2677. \return
  2678. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2679. \rst
  2680. +------------------------------+------------------------------------------------+
  2681. | Error Code | Description |
  2682. +==============================+================================================+
  2683. | ERR_CFW_INVALID_PARAMETER | The input parameter is NULL |
  2684. +------------------------------+------------------------------------------------+
  2685. | ERR_CME_DIAL_STRING_TOO_LONG | The input dial number string is tool long(>40) |
  2686. +------------------------------+------------------------------------------------+
  2687. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system. |
  2688. +------------------------------+------------------------------------------------+
  2689. | ERR_CME_MEMORY_FULL | No any more memory to use. |
  2690. +------------------------------+------------------------------------------------+
  2691. \endrst
  2692. */
  2693. uint32_t CFW_CcInitiateSpeechCallEx_V2(
  2694. CFW_DIALNUMBER_V2 *pDialNumber,
  2695. uint8_t *pIndex,
  2696. uint16_t nUTI,
  2697. CFW_SIM_ID nSimId);
  2698. /*! \brief The function calls the emergency service
  2699. \param [in] pNumber Pointer to uint8_t to hold the number in GSM BCD format.
  2700. \param [in] nSize The size of telephone number, the MAX. value of this parameter is 2.
  2701. \param [in] nSimID SIM ID
  2702. \return \a ERR_SUCCESS on success, or error code
  2703. */
  2704. uint32_t CFW_CcEmcDial(
  2705. uint8_t *pNumber,
  2706. uint8_t nSize,
  2707. CFW_SIM_ID nSimId);
  2708. /*! \brief The function calls the emergency service
  2709. \param [in] pNumber Pointer to uint8_t to hold the number in GSM BCD format.
  2710. \param [in] nDialNumberSize The size of telephone number, the MAX. value of this parameter is 2.
  2711. \param [out] pIndex the index of the setup call
  2712. \param [in] nSimID SIM ID
  2713. \return \a ERR_SUCCESS on success, or error code
  2714. */
  2715. uint32_t CFW_CcEmcDialEx(
  2716. uint8_t *pDialNumber,
  2717. uint8_t nDialNumberSize,
  2718. uint8_t *pIndex,
  2719. CFW_SIM_ID nSimId);
  2720. uint32_t CFW_CcEmcDialEx_V2(
  2721. uint8_t *pDialNumber,
  2722. uint8_t nDialNumberSize,
  2723. uint8_t *pIndex,
  2724. CFW_CcEmergCateg emergCateg,
  2725. CFW_SIM_ID nSimId);
  2726. /*! \brief The function disconnects any call in progress, such as voice calls or CSD data calls.
  2727. The result should be returned asynchronously through the EV_CFW_CC_RELEASE_CALL_RSP event:
  2728. \rst
  2729. +------+---------+-------------------+-------------------+----------------------+
  2730. | UTI | nType | nParam1 | nParam2 | Description |
  2731. +======+=========+===================+===================+======================+
  2732. | | | | | |
  2733. | nUTI | 0x10/30 | 1 to 7. | Network Error cod | OK |
  2734. +------+---------+-------------------+-------------------+----------------------+
  2735. | nUTI | 0x20 | 0 | 0 | When no any call, |
  2736. | | | | | this function called |
  2737. +------+---------+-------------------+-------------------+----------------------+
  2738. | | | | HIUINT16=number | |
  2739. | nUTI | 0xF0 | Network Error cod | LOUINT16 = | Error |
  2740. | | | | network casue | |
  2741. +------+---------+-------------------+-------------------+----------------------+
  2742. \endrst
  2743. \param [in] nSimID SIM ID
  2744. \return
  2745. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2746. \rst
  2747. +-------------------------------------------+-------------------------------------+
  2748. | Error Code | Description |
  2749. +===========================================+=====================================+
  2750. | ERR_CME_OPERATION_TEMPORARILY_NOT_ALLOWED | Temporarily operate is not allowed. |
  2751. +-------------------------------------------+-------------------------------------+
  2752. \endrst
  2753. */
  2754. uint32_t CFW_CcReleaseCall(
  2755. CFW_SIM_ID nSimId);
  2756. uint32_t CFW_CcReleaseCall_V2(uint16_t nUTI,
  2757. CFW_SIM_ID nSimId);
  2758. /*! \brief The function disconnects any call in progress, such as voice calls or CSD data calls.
  2759. The result should be returned asynchronously through the EV_CFW_CC_RELEASE_CALL_RSP event:
  2760. \rst
  2761. +------+-------+------------------+--------------------+-------------+
  2762. | UTI | nType | nParam1 | nParam2 | Description |
  2763. +======+=======+==================+====================+=============+
  2764. | | | | | |
  2765. | nUTI | 0x10 | 1 to 7. | Network Error cod | OK |
  2766. +------+-------+------------------+--------------------+-------------+
  2767. | | | | HIUINT16=cc number | |
  2768. | nUTI | 0xF0 | network casue:16 | LOUINT16 = | Error |
  2769. | | | | network casue | |
  2770. +------+-------+------------------+--------------------+-------------+
  2771. \endrst
  2772. \param [in] nSimID SIM ID
  2773. \return
  2774. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2775. \rst
  2776. +-------------------------------------------+-------------------------------------+
  2777. | Error Code | Description |
  2778. +===========================================+=====================================+
  2779. | ERR_CME_OPERATION_TEMPORARILY_NOT_ALLOWED | Temporarily operate is not allowed. |
  2780. +-------------------------------------------+-------------------------------------+
  2781. \endrst
  2782. */
  2783. uint32_t CFW_CcRejectCall(
  2784. CFW_SIM_ID nSimId);
  2785. /*! \brief The function sends DTMF tones over the GSM network.
  2786. \param [in] iTone A single ASCII character in the set of 0-9, #, *, and A-D to send.
  2787. \param [in] nSimID SIM ID
  2788. \return \a ERR_SUCCESS on success, or error code
  2789. */
  2790. uint32_t CFW_CcPlayTone(
  2791. int8_t iTone,
  2792. CFW_SIM_ID nSimId);
  2793. /*! \brief The function stops to send DTMF tones over the GSM network.
  2794. \param [in] nSimID SIM ID
  2795. \return \a ERR_SUCCESS on success, or error code
  2796. */
  2797. uint32_t CFW_CcStopTone(
  2798. CFW_SIM_ID nSimId);
  2799. uint32_t CFW_CcSetCsfbmtFlag(uint8_t nFlag, CFW_SIM_ID nSim);
  2800. uint32_t CFW_CcGetCsfbmtFlag(CFW_SIM_ID nSim);
  2801. #ifdef AT_EXT_CONF_SUPPORT
  2802. uint32_t CFW_CcGetMptyNum(
  2803. uint8_t *pMptyCnt,
  2804. CFW_SIM_ID nSimId);
  2805. uint32_t CFW_CcExtConfCallDial(
  2806. CFW_DIAL_EXT_CONF_CT *pDialNumber,
  2807. uint8_t *pIndex,
  2808. uint16_t nUTI,
  2809. CFW_SIM_ID nSimId);
  2810. uint32_t CFW_CcExtConfCallAdd(
  2811. CFW_DIAL_EXT_CONF_CT *pDialNumber,
  2812. uint16_t nUTI,
  2813. CFW_SIM_ID nSimId);
  2814. #endif
  2815. /*! \brief The CFW_SsQueryCallWaiting function interrogates the status of call waiting.
  2816. The result should be returned through the EV_CFW_SS_QUERY_CALL_WAITING_RSP event:
  2817. \rst
  2818. +-------+---------------------------------------------+----------------------------------+------------------+
  2819. | nType | nParam1 | nParam2 | Description |
  2820. +=======+=============================================+==================================+==================+
  2821. | | Bit0:VOICE,Bit1:DATA,BIT2:FAX,BIT3:SMS... | bit0 = 1: indicate VOICE class | |
  2822. | | the status | bit1 = 1: indicate data class | |
  2823. | 0x00 | bit0 = 0: VOICE is not active | bit2 = 1: indicate fax class | OK |
  2824. | | bit0 = 1: VOICE is active ... | bit3 = 1: indicate sms class | |
  2825. +-------+---------------------------------------------+----------------------------------+------------------+
  2826. | | HIUINT16= ss_code(ss_CW = 0x41) | HIUINT16(nParam2)=0 | |
  2827. | 0xFA | LOUINT16=ss_operations(SS_Interrogate = 14) | LOUINT16(nParam2)=LocalErrorCode | LocalError |
  2828. +-------+---------------------------------------------+----------------------------------+------------------+
  2829. | | HIUINT16= ss_code(ss_CW = 0x41) | HIUINT16(nParam2)=0 | Nwk returned a |
  2830. | 0xFB | LOUINT16=ss_operations(SS_Interrogate = 14) | LOUINT16(nParam2)=NWErrorCode | return error |
  2831. +-------+---------------------------------------------+----------------------------------+------------------+
  2832. | | HIUINT16= ss_code(ss_CW = 0x41) | HIUINT16(nParam2)=ProblemCodeTag | NW returned a |
  2833. | 0xFC | LOUINT16=ss_operations(SS_Interrogate = 14) | LOUINT16(nParam2)=ProblemCode | reject component |
  2834. +-------+---------------------------------------------+----------------------------------+------------------+
  2835. | | HIUINT16= ss_code(ss_CW = 0x41) | HIUINT16(nParam2)=0 | Nwk returned a |
  2836. | 0xFD | LOUINT16=ss_operations(SS_Interrogate = 14) | LOUINT16(nParam2)=causevalue | Cause error |
  2837. +-------+---------------------------------------------+----------------------------------+------------------+
  2838. \endrst
  2839. \param [in] nClass Specify the sum of class to represent the class information which show below: See MMI Service Code For more
  2840. \rst
  2841. +-------+------------------------------------+
  2842. | Class | Description |
  2843. +=======+====================================+
  2844. | 11 | Telephony, voice service. |
  2845. +-------+------------------------------------+
  2846. | 13 | Facsimile services |
  2847. +-------+------------------------------------+
  2848. | 16 | Short Message Services |
  2849. +-------+------------------------------------+
  2850. | 20 | All bearer services, data service. |
  2851. +-------+------------------------------------+
  2852. \endrst
  2853. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  2854. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  2855. module. This parameter should be less than 255 for all upper layer application.
  2856. \param [in] nSimID SIM ID
  2857. \return
  2858. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2859. \rst
  2860. +----------------------------+------------------------------------------------------------------+
  2861. | Error Code | Description |
  2862. +============================+==================================================================+
  2863. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  2864. +----------------------------+------------------------------------------------------------------+
  2865. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  2866. +----------------------------+------------------------------------------------------------------+
  2867. | | Indicates the event could not be immediately placed in the queue |
  2868. | ERR_COS_QUEUE_FULL | because there was not enough space available, so this function |
  2869. | | fail to send event to CFW. |
  2870. +----------------------------+------------------------------------------------------------------+
  2871. | ERR_CME_MEMORY_FULL | No any more memory to allocate |
  2872. +----------------------------+------------------------------------------------------------------+
  2873. | ERR_CME_UNKNOWN | Unknown error occur. |
  2874. +----------------------------+------------------------------------------------------------------+
  2875. \endrst
  2876. */
  2877. uint32_t CFW_SsQueryCallWaiting(
  2878. uint8_t nClass,
  2879. uint16_t nUTI,
  2880. CFW_SIM_ID nSimID);
  2881. /*! \brief The CFW_SsSetCallWaiting function controls the Call Waiting supplementary service according to 3GPP TS 22.083 [5].
  2882. The result should be returned through the EV_CFW_SS_SET_CALL_WAITING_RSP event:
  2883. \rst
  2884. +-------+---------------------------------+----------------------------------+------------------+
  2885. | nType | nParam1 | nParam2 | Description |
  2886. +=======+=================================+==================================+==================+
  2887. | | mode = 1:active | | |
  2888. | 0x00 | mode = 0:deactive | 0 | OK |
  2889. +-------+---------------------------------+----------------------------------+------------------+
  2890. | | HIUINT16= ss_code(ss_CW = 0x41) | | |
  2891. | | LOUINT16=ss_operations | HIUINT16(nParam2)=0 | |
  2892. | 0xFA | (mode = 1:SS_Activate = 12, | LOUINT16(nParam2)=LocalErrorCode | LocalError |
  2893. | | mode = 0:SS_Deactivate = 13) | | |
  2894. +-------+---------------------------------+----------------------------------+------------------+
  2895. | | HIUINT16= ss_code(ss_CW = 0x41) | | |
  2896. | | LOUINT16=ss_operations | HIUINT16(nParam2)=0 | Nwk returned a |
  2897. | 0xFB | (mode = 1:SS_Activate = 12, | LOUINT16(nParam2)=NWErrorCode | return error |
  2898. | | mode = 0:SS_Deactivate = 13) | | |
  2899. +-------+---------------------------------+----------------------------------+------------------+
  2900. | | HIUINT16= ss_code(ss_CW = 0x41) | | |
  2901. | | LOUINT16=ss_operations | HIUINT16(nParam2)=ProblemCodeTag | NW returned a |
  2902. | 0xFC | (mode = 1:SS_Activate = 12, | LOUINT16(nParam2)=ProblemCode | reject component |
  2903. | | mode = 0:SS_Deactivate = 13) | | |
  2904. +-------+---------------------------------+----------------------------------+------------------+
  2905. | | HIUINT16= ss_code(ss_CW = 0x41) | | |
  2906. | | LOUINT16=ss_operations | HIUINT16(nParam2)=0 | Nwk returned a |
  2907. | 0xFD | (mode = 1:SS_Activate = 12, | LOUINT16(nParam2)=causevalue | Cause IE |
  2908. | | mode = 0:SS_Deactivate = 13) | | |
  2909. +-------+---------------------------------+----------------------------------+------------------+
  2910. \endrst
  2911. \param [in] nMode Specify the value to disable(0)/enable(1) call waiting.
  2912. \param [in] nClass Specify the sum of class to represent the class information which show below: See MMI Service Code For more
  2913. \rst
  2914. +-------+------------------------------------+
  2915. | Class | Description |
  2916. +=======+====================================+
  2917. | 11 | Telephony, voice service. |
  2918. +-------+------------------------------------+
  2919. | 13 | Facsimile services |
  2920. +-------+------------------------------------+
  2921. | 16 | Short Message Services |
  2922. +-------+------------------------------------+
  2923. | 20 | All bearer services, data service. |
  2924. +-------+------------------------------------+
  2925. \endrst
  2926. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  2927. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  2928. module. This parameter should be less than 255 for all upper layer application.
  2929. \param [in] nSimID SIM ID
  2930. \return
  2931. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2932. \rst
  2933. +----------------------------+------------------------------------------------------------------+
  2934. | Error Code | Description |
  2935. +============================+==================================================================+
  2936. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  2937. +----------------------------+------------------------------------------------------------------+
  2938. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  2939. +----------------------------+------------------------------------------------------------------+
  2940. | | Indicates the event could not be immediately placed in the queue |
  2941. | ERR_COS_QUEUE_FULL | because there was not enough space available, so this function |
  2942. | | fail to send event to CFW. |
  2943. +----------------------------+------------------------------------------------------------------+
  2944. | ERR_CME_UNKNOWN | Unknown error occur. |
  2945. +----------------------------+------------------------------------------------------------------+
  2946. \endrst
  2947. */
  2948. uint32_t CFW_SsSetCallWaiting(
  2949. uint8_t nMode,
  2950. uint8_t nClass,
  2951. uint16_t nUTI,
  2952. CFW_SIM_ID nSimID);
  2953. /*! \brief The CFW_SsSetCallForwarding function sets the call forwarding number and conditions.
  2954. The result should be returned through the EV_CFW_SS_SET_CALL_FORWARDING_RSP event
  2955. \rst
  2956. +-------+------------------------------------------+----------------------------------+------------------+
  2957. | nType | nParam1 | nParam2 | Description |
  2958. +=======+==========================================+==================================+==================+
  2959. | | Point to CFW_SS_SET_CALLFORWARDING_INFO | | |
  2960. | 0x00 | structure array referenced by nParam1. | 0 | OK |
  2961. +-------+------------------------------------------+----------------------------------+------------------+
  2962. | | HIUINT16= ss_code(ss_CFA = 0x20,ss_CFU = | | |
  2963. | | 0x21, ss_CFC = 0x28, ss_CFB = 0x29, | | |
  2964. | | ss_CFNRY = 0x2A, ss_CFNRC = 0x2B) | | |
  2965. | | LOUINT16=ss_operations | HIUINT16(nParam2)=0 | |
  2966. | 0xFA | (mode = 1:SS_Activate = 12, | LOUINT16(nParam2)=LocalErrorCode | LocalError |
  2967. | | mode = 0:SS_Deactivate = 13) | | |
  2968. +-------+------------------------------------------+----------------------------------+------------------+
  2969. | | HIUINT16= ss_code(ss_CFA = 0x20,ss_CFU = | | |
  2970. | | 0x21, ss_CFC = 0x28, ss_CFB = 0x29, | | |
  2971. | | ss_CFNRY = 0x2A, ss_CFNRC = 0x2B) | | |
  2972. | | LOUINT16=ss_operations | HIUINT16(nParam2)=0 | Nwk returned a |
  2973. | 0xFB | (mode = 1:SS_Activate = 12, | LOUINT16(nParam2)=NWErrorCode | return error |
  2974. | | mode = 0:SS_Deactivate = 13) | | |
  2975. +-------+------------------------------------------+----------------------------------+------------------+
  2976. | | HIUINT16= ss_code(ss_CFA = 0x20,ss_CFU = | | |
  2977. | | 0x21, ss_CFC = 0x28, ss_CFB = 0x29, | | |
  2978. | | ss_CFNRY = 0x2A, ss_CFNRC = 0x2B) | | |
  2979. | | LOUINT16=ss_operations | HIUINT16(nParam2)=ProblemCodeTag | NW returned a |
  2980. | 0xFC | (mode = 1:SS_Activate = 12, | LOUINT16(nParam2)=ProblemCode | reject component |
  2981. | | mode = 0:SS_Deactivate = 13) | | |
  2982. +-------+------------------------------------------+----------------------------------+------------------+
  2983. | | HIUINT16= ss_code(ss_CFA = 0x20,ss_CFU = | | |
  2984. | | 0x21, ss_CFC = 0x28, ss_CFB = 0x29, | | |
  2985. | | ss_CFNRY = 0x2A, ss_CFNRC = 0x2B) | | |
  2986. | | LOUINT16=ss_operations | HIUINT16(nParam2)=0 | Nwk returned a |
  2987. | 0xFD | (mode = 1:SS_Activate = 12, | LOUINT16(nParam2)=causevalue | Cause IE |
  2988. | | mode = 0:SS_Deactivate = 13) | | |
  2989. +-------+------------------------------------------+----------------------------------+------------------+
  2990. \endrst
  2991. \param [in] pCallForwarding Pointer to an array of CFW_SS_SET_CALLFORWARDING_INFO structure to contain the forwarding number and conditions.
  2992. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  2993. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  2994. module. This parameter should be less than 255 for all upper layer application.
  2995. \param [in] nSimID SIM ID
  2996. \return
  2997. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  2998. \rst
  2999. +----------------------------+------------------------------------------------------------------+
  3000. | Error Code | Description |
  3001. +============================+==================================================================+
  3002. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  3003. +----------------------------+------------------------------------------------------------------+
  3004. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  3005. +----------------------------+------------------------------------------------------------------+
  3006. | | Indicates the event could not be immediately placed in the queue |
  3007. | ERR_COS_QUEUE_FULL | because there was not enough space available, so this function |
  3008. | | fail to send event to CFW. |
  3009. +----------------------------+------------------------------------------------------------------+
  3010. | ERR_CME_UNKNOWN | Unknown error occur. |
  3011. +----------------------------+------------------------------------------------------------------+
  3012. | ERR_CME_MEMORY_FULL | No any more memory to allocate |
  3013. +----------------------------+------------------------------------------------------------------+
  3014. \endrst
  3015. */
  3016. uint32_t CFW_SsSetCallForwarding(
  3017. CFW_SS_SET_CALLFORWARDING_INFO *pCallForwarding,
  3018. uint16_t nUTI,
  3019. CFW_SIM_ID nSimID);
  3020. /*! \brief The CFW_SsQueryCallForwarding function interrogates the call forwarding number and conditions.
  3021. The result should be returned through the EV_CFW_SS_QUERY_CALL_FORWARDING_RSP event:
  3022. \rst
  3023. +-------+------------------------------------------+----------------------------------+------------------+
  3024. | nType | nParam1 | nParam2 | Description |
  3025. +=======+==========================================+==================================+==================+
  3026. | | Point to CFW_SS_QUERY_CALLFORWARDING_RSP | | |
  3027. | 0x00 | structure array referenced by nParam1. | The counter of structure array | OK |
  3028. +-------+------------------------------------------+----------------------------------+------------------+
  3029. | | HIUINT16= ss_code(ss_CFA = 0x20,ss_CFU = | | |
  3030. | | 0x21, ss_CFC = 0x28, ss_CFB = 0x29, | | |
  3031. | | ss_CFNRY = 0x2A, ss_CFNRC = 0x2B) | | |
  3032. | | LOUINT16=ss_operations | HIUINT16(nParam2)=0 | |
  3033. | 0xFA | (mode = 1:SS_Activate = 12, | LOUINT16(nParam2)=LocalErrorCode | LocalError |
  3034. | | mode = 0:SS_Deactivate = 13 | | |
  3035. | | mode = 3:SS_Deactivate = 10 | | |
  3036. | | mode = 4:SS_Deactivate = 11) | | |
  3037. +-------+------------------------------------------+----------------------------------+------------------+
  3038. | | HIUINT16= ss_code(ss_CFA = 0x20,ss_CFU = | | |
  3039. | | 0x21, ss_CFC = 0x28, ss_CFB = 0x29, | | |
  3040. | | ss_CFNRY = 0x2A, ss_CFNRC = 0x2B) | | |
  3041. | | LOUINT16=ss_operations | HIUINT16(nParam2)=0 | Nwk returned a |
  3042. | 0xFB | (mode = 1:SS_Activate = 12, | LOUINT16(nParam2)=NWErrorCode | return error |
  3043. | | mode = 0:SS_Deactivate = 13 | | |
  3044. | | mode = 3:SS_Deactivate = 10 | | |
  3045. | | mode = 4:SS_Deactivate = 11) | | |
  3046. +-------+------------------------------------------+----------------------------------+------------------+
  3047. | | HIUINT16= ss_code(ss_CFA = 0x20,ss_CFU = | | |
  3048. | | 0x21, ss_CFC = 0x28, ss_CFB = 0x29, | | |
  3049. | | ss_CFNRY = 0x2A, ss_CFNRC = 0x2B) | | |
  3050. | | LOUINT16=ss_operations | HIUINT16(nParam2)=ProblemCodeTag | NW returned a |
  3051. | 0xFC | (mode = 0:SS_Activate = 12, | LOUINT16(nParam2)=ProblemCode | reject component |
  3052. | | mode = 0:SS_Deactivate = 13 | | |
  3053. | | mode = 3:SS_Deactivate = 10 | | |
  3054. | | mode = 4:SS_Deactivate = 11) | | |
  3055. +-------+------------------------------------------+----------------------------------+------------------+
  3056. | | HIUINT16= ss_code(ss_CFA = 0x20,ss_CFU = | | |
  3057. | | 0x21, ss_CFC = 0x28, ss_CFB = 0x29, | | |
  3058. | | ss_CFNRY = 0x2A, ss_CFNRC = 0x2B) | | |
  3059. | | LOUINT16=ss_operations | HIUINT16(nParam2)=0 | Nwk returned a |
  3060. | 0xFD | (mode = 1:SS_Activate = 12, | LOUINT16(nParam2)=causevalue | Cause IE |
  3061. | | mode = 0:SS_Deactivate = 13 | | |
  3062. | | mode = 3:SS_Deactivate = 10 | | |
  3063. | | mode = 4:SS_Deactivate = 11) | | |
  3064. +-------+------------------------------------------+----------------------------------+------------------+
  3065. \endrst
  3066. \param [in] nReason Specify one of the forwarding reasons to interrogate. It can be any one of the following values:
  3067. \rst
  3068. +----------------------------------------+-------+--------------------------------------+
  3069. | Forwarding Reason | Value | Description |
  3070. +========================================+=======+======================================+
  3071. | CFW_CM_FORWARDING_REASON_UNCONDITIONAL | 0 | Forward unconditionally. |
  3072. +----------------------------------------+-------+--------------------------------------+
  3073. | CFW_CM_FORWARDING_REASON_MOBILEBUSY | 1 | Forward if the mobile phone is busy |
  3074. +----------------------------------------+-------+--------------------------------------+
  3075. | CFW_CM_FORWARDING_REASON_NOREPLY | 2 | Forward if there is no answer |
  3076. +----------------------------------------+-------+--------------------------------------+
  3077. | CFW_CM_FORWARDING_REASON_NOTREACHABLE | 3 | Forward if the number is unreachable |
  3078. +----------------------------------------+-------+--------------------------------------+
  3079. \endrst
  3080. \param [in] nClass Specify the sum of class to represent the class information which show below: See MMI Service Code For more
  3081. \rst
  3082. +-------+------------------------------------+
  3083. | Class | Description |
  3084. +=======+====================================+
  3085. | 11 | Telephony, voice service. |
  3086. +-------+------------------------------------+
  3087. | 13 | Facsimile services |
  3088. +-------+------------------------------------+
  3089. | 16 | Short Message Services |
  3090. +-------+------------------------------------+
  3091. | 20 | All bearer services, data service. |
  3092. +-------+------------------------------------+
  3093. \endrst
  3094. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  3095. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  3096. module. This parameter should be less than 255 for all upper layer application.
  3097. \param [in] nSimID SIM ID
  3098. \return
  3099. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  3100. \rst
  3101. +----------------------------+------------------------------------------------------------------+
  3102. | Error Code | Description |
  3103. +============================+==================================================================+
  3104. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  3105. +----------------------------+------------------------------------------------------------------+
  3106. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  3107. +----------------------------+------------------------------------------------------------------+
  3108. | | Indicates the event could not be immediately placed in the queue |
  3109. | ERR_COS_QUEUE_FULL | because there was not enough space available, so this function |
  3110. | | fail to send event to CFW. |
  3111. +----------------------------+------------------------------------------------------------------+
  3112. | ERR_CME_UNKNOWN | Unknown error occur. |
  3113. +----------------------------+------------------------------------------------------------------+
  3114. | ERR_CME_MEMORY_FULL | No any more memory to allocate |
  3115. +----------------------------+------------------------------------------------------------------+
  3116. \endrst
  3117. */
  3118. uint32_t CFW_SsQueryCallForwarding(
  3119. uint8_t nReason,
  3120. uint8_t nClass,
  3121. uint16_t nUTI,
  3122. CFW_SIM_ID nSimID);
  3123. #define CFW_STY_FAC_TYPE_AO 0x414F ///< BAOC (Bar All Outgoing Calls)
  3124. #define CFW_STY_FAC_TYPE_OI 0x4F49 ///< BOIC (Bar Outgoing International Calls)
  3125. #define CFW_STY_FAC_TYPE_OX 0x4F58 ///< BOIC-exHC (Bar Outgoing International Calls except to Home Country)
  3126. #define CFW_STY_FAC_TYPE_AI 0x4149 ///< BAIC (Bar All Incoming Calls)
  3127. #define CFW_STY_FAC_TYPE_IR 0x4952 ///< BIC-Roam (Bar Incoming Calls when Roaming outside the home country)
  3128. #define CFW_STY_FAC_TYPE_AB 0x4142 ///< All Barring services (only applicable for mode=0)
  3129. #define CFW_STY_FAC_TYPE_AG 0x4147 ///< All outGoing barring services (only applicable for mode=0)
  3130. #define CFW_STY_FAC_TYPE_AC 0x4143 ///< All inComing barring services (only applicable for mode=0)
  3131. #define CFW_CM_MODE_UNLOCK 0 ///< unlock
  3132. #define CFW_CM_MODE_LOCK 1 ///< lock
  3133. #define CFW_SS_FORWARDING_REASON_UNCONDITIONAL 0 ///< Forward unconditionally.
  3134. #define CFW_SS_FORWARDING_REASON_MOBILEBUSY 1 ///< Forward if the mobile phone is busy
  3135. #define CFW_SS_FORWARDING_REASON_NOREPLY 2 ///< Forward if there is no answer
  3136. #define CFW_SS_FORWARDING_REASON_NOTREACHABLE 3 ///< Forward if the number is unreachable.
  3137. #define CFW_SS_FORWARDING_REASON_ALL_CALLFORWARDING 4 ///< All call forwarding reasons(includes reasons 0, 1, 2 and 3).
  3138. #define CFW_SS_FORWARDING_REASON_ALL_CONDCALLFORWARDING 5 ///< All conditional call forwarding reasons(includes reasons 1, 2 and 3).
  3139. //#ifdef CFW_VOLTE_SUPPORT //quectel modify
  3140. #define CFW_SS_FORWARDING_REASON_COMMUNICATION_DEFLECT 6 ///< communication deflection
  3141. #define CFW_SS_FORWARDING_REASON_NOT_LOGGED_IN 7 ///< communication forwarding on not logged-in
  3142. //#endif //quectel modify
  3143. #define CFW_SS_FORWARDING_MODE_DISABLE 0
  3144. #define CFW_SS_FORWARDING_MODE_ENABLE 1
  3145. #define CFW_SS_FORWARDING_MODE_QUERY 2
  3146. #define CFW_SS_FORWARDING_MODE_REGISTRATION 3
  3147. #define CFW_SS_FORWARDING_MODE_ERASURE 4
  3148. /*! \brief The CFW_SsSetFacilityLock function locks, unlocks a MT or a network facility such as call barring.
  3149. The result should be returned through the EV_CFW_SS_SET_FACILITY_LOCK_RSP event:
  3150. \rst
  3151. +-------+------------------------------------+---------------------+------------------+
  3152. | nType | nParam1 | nParam2 | Description |
  3153. +=======+====================================+=====================+==================+
  3154. | | HIUINT16 (nParam1)=fac | HIUINT16=class | |
  3155. | 0x00 | LOUINT16(nParam1)=mode | LOUINT16=status | OK |
  3156. +-------+------------------------------------+---------------------+------------------+
  3157. | | HIUINT16= ss_code | | |
  3158. | | (ss_AllBarringSS=0x90, | | |
  3159. | | ss_BarringOfOutgoingCalls=0x91, | | |
  3160. | | ss_BAOC=0x92,ss_BOIC=0x93, | | |
  3161. | | ss_BOIC_ExHC = 0x94, | | |
  3162. | | ss_BarringOfIncomingCalls=0x99, | HIUINT16(nParam2)=0 | |
  3163. | 0xFA | ss_BAIC = 0x9A,ss_BIC_ROAM = 0x9B) | LOUINT16(nParam2)= | LocalError |
  3164. | | LOUINT16 (nParam1)=ss_operations | LocalErrorCode | |
  3165. | | (mode = 1:SS_Activate = 12, | | |
  3166. | | mode = 0:SS_Deactivate = 13) | | |
  3167. +-------+------------------------------------+---------------------+------------------+
  3168. | | HIUINT16= ss_code | | |
  3169. | | (ss_AllBarringSS=0x90, | | |
  3170. | | ss_BarringOfOutgoingCalls=0x91, | | |
  3171. | | ss_BAOC=0x92,ss_BOIC=0x93, | | |
  3172. | | ss_BOIC_ExHC = 0x94, | | |
  3173. | | ss_BarringOfIncomingCalls=0x99, | HIUINT16(nParam2)=0 | Nwk returned a |
  3174. | 0xFB | ss_BAIC = 0x9A,ss_BIC_ROAM = 0x9B) | LOUINT16(nParam2)= | return error |
  3175. | | LOUINT16 (nParam1)=ss_operations | NWErrorCode | |
  3176. | | (mode = 1:SS_Activate = 12, | | |
  3177. | | mode = 0:SS_Deactivate = 13) | | |
  3178. +-------+------------------------------------+---------------------+------------------+
  3179. | | HIUINT16= ss_code | | |
  3180. | | (ss_AllBarringSS=0x90, | | |
  3181. | | ss_BarringOfOutgoingCalls=0x91, | | |
  3182. | | ss_BAOC=0x92,ss_BOIC=0x93, | | |
  3183. | | ss_BOIC_ExHC = 0x94, | HIUINT16(nParam2)= | |
  3184. | | ss_BarringOfIncomingCalls=0x99, | ProblemCodeTag | NW returned a |
  3185. | 0xFC | ss_BAIC = 0x9A,ss_BIC_ROAM = 0x9B) | LOUINT16(nParam2)= | reject component |
  3186. | | LOUINT16 (nParam1)=ss_operations | ProblemCode | |
  3187. | | (mode = 1:SS_Activate = 12, | | |
  3188. | | mode = 0:SS_Deactivate = 13) | | |
  3189. +-------+------------------------------------+---------------------+------------------+
  3190. | | HIUINT16= ss_code | | |
  3191. | | (ss_AllBarringSS=0x90, | | |
  3192. | | ss_BarringOfOutgoingCalls=0x91, | | |
  3193. | | ss_BAOC=0x92,ss_BOIC=0x93, | | |
  3194. | | ss_BOIC_ExHC = 0x94, | | |
  3195. | | ss_BarringOfIncomingCalls=0x99, | HIUINT16(nParam2)=0 | Nwk returned a |
  3196. | 0xFD | ss_BAIC = 0x9A,ss_BIC_ROAM = 0x9B) | LOUINT16(nParam2)= | Cause IE |
  3197. | | LOUINT16 (nParam1)=ss_operations | causevalue | |
  3198. | | (mode = 1:SS_Activate = 12, | | |
  3199. | | mode = 0:SS_Deactivate = 13) | | |
  3200. +-------+------------------------------------+---------------------+------------------+
  3201. \endrst
  3202. \param [in] nFac Specify the facility to check its status. The facility type can be one of the following value:
  3203. \rst
  3204. +---------------------+--------+---------------------------------------------------------------------+
  3205. | Facility type | Value | Description |
  3206. +=====================+========+=====================================================================+
  3207. | CFW_STY_FAC_TYPE_AO | 0x414F | BAOC (Bar All Outgoing Calls) |
  3208. +---------------------+--------+---------------------------------------------------------------------+
  3209. | CFW_STY_FAC_TYPE_OI | 0x4F49 | BOIC (Bar Outgoing International Cal |
  3210. +---------------------+--------+---------------------------------------------------------------------+
  3211. | CFW_STY_FAC_TYPE_OX | 0x4F58 | BOIC-exHC (Bar Outgoing International Calls except to Home Country) |
  3212. +---------------------+--------+---------------------------------------------------------------------+
  3213. | CFW_STY_FAC_TYPE_AI | 0x4149 | BAIC (Bar All Incoming Calls) |
  3214. +---------------------+--------+---------------------------------------------------------------------+
  3215. | CFW_STY_FAC_TYPE_IR | 0x4952 | BIC-Roam (Bar Incoming Calls when Roaming outside the home country) |
  3216. +---------------------+--------+---------------------------------------------------------------------+
  3217. | CFW_STY_FAC_TYPE_AB | 0x4142 | All Barring services (applicable only for nMode=0) |
  3218. +---------------------+--------+---------------------------------------------------------------------+
  3219. | CFW_STY_FAC_TYPE_AG | 0x4147 | All outGoing barring services (applicable only for nMode=0) |
  3220. +---------------------+--------+---------------------------------------------------------------------+
  3221. | CFW_STY_FAC_TYPE_AC | 0x4143 | All inComing barring services (applicable only for nMode=0) |
  3222. +---------------------+--------+---------------------------------------------------------------------+
  3223. \endrst
  3224. \param [in] pBufPwd Point to the buffer containing the password in ASCII string format. If you don't care password, set this pBufPwd to NULL.
  3225. \param [in] nPwdSize The size of pBufPwdin bytes. If pBufPwd is NULL, this parameter is ignored by this function.
  3226. \param [in] nClass Specify the sum of class to represent the class information which show below: See MMI Service Code For more
  3227. \rst
  3228. +-------+------------------------------------+
  3229. | Class | Description |
  3230. +=======+====================================+
  3231. | 11 | Telephony, voice service. |
  3232. +-------+------------------------------------+
  3233. | 13 | Facsimile services |
  3234. +-------+------------------------------------+
  3235. | 16 | Short Message Services |
  3236. +-------+------------------------------------+
  3237. | 20 | All bearer services, data service. |
  3238. +-------+------------------------------------+
  3239. \endrst
  3240. \param [in] nMode Specify the mode which show below:
  3241. \rst
  3242. +--------------------+-------+-----------------+
  3243. | nMode | Value | Description |
  3244. +====================+=======+=================+
  3245. | CFW_CM_MODE_UNLOCK | 0 | unlock,deactive |
  3246. +--------------------+-------+-----------------+
  3247. | CFW_CM_MODE_LOCK | 1 | lock,active |
  3248. +--------------------+-------+-----------------+
  3249. \endrst
  3250. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  3251. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  3252. module. This parameter should be less than 255 for all upper layer application.
  3253. \param [in] nSimID SIM ID
  3254. \return
  3255. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  3256. \rst
  3257. +-------------------------------+------------------------------------------------------------------+
  3258. | Error Code | Description |
  3259. +===============================+==================================================================+
  3260. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  3261. +-------------------------------+------------------------------------------------------------------+
  3262. | | This function don't complete, and you execute the same |
  3263. | ERR_CME_OPERATION_NOT_ALLOWED | operations such as call this function again. |
  3264. +-------------------------------+------------------------------------------------------------------+
  3265. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  3266. +-------------------------------+------------------------------------------------------------------+
  3267. | | Indicates the event could not be immediately placed in the queue |
  3268. | ERR_COS_QUEUE_FULL | because there was not enough space available, so this function |
  3269. | | fail to send event to CFW. |
  3270. +-------------------------------+------------------------------------------------------------------+
  3271. | ERR_CME_UNKNOWN | Unknown error occur. |
  3272. +-------------------------------+------------------------------------------------------------------+
  3273. | ERR_CME_MEMORY_FULL | No any more memory to allocate |
  3274. +-------------------------------+------------------------------------------------------------------+
  3275. \endrst
  3276. */
  3277. uint32_t CFW_SsSetFacilityLock(
  3278. uint16_t nFac,
  3279. uint8_t *pBufPwd,
  3280. uint8_t nPwdSize,
  3281. uint8_t nClass,
  3282. uint8_t nMode,
  3283. uint16_t nUTI,
  3284. CFW_SIM_ID nSimID);
  3285. /*! \brief The CFW_SsQueryFacilityLock function retrieves the status of supplementary Service about Call barring.
  3286. The result should be returned through the the EV_CFW_SS_QUERY_FACILITY_LOCK_RSP event:
  3287. \rst
  3288. +-------+------------------------------------+---------------------+------------------+
  3289. | nType | nParam1 | nParam2 | Description |
  3290. +=======+====================================+=====================+==================+
  3291. | | Specify the facility | HIUINT16=class | |
  3292. | 0x00 | see nFac parameter below. | LOUINT16=status | OK |
  3293. +-------+------------------------------------+---------------------+------------------+
  3294. | | HIUINT16= ss_code | | |
  3295. | | (ss_AllBarringSS=0x90, | | |
  3296. | | ss_BarringOfOutgoingCalls=0x91, | | |
  3297. | | ss_BAOC=0x92,ss_BOIC=0x93, | | |
  3298. | | ss_BOIC_ExHC = 0x94, | | |
  3299. | | ss_BarringOfIncomingCalls=0x99, | HIUINT16(nParam2)=0 | |
  3300. | 0xFA | ss_BAIC = 0x9A,ss_BIC_ROAM = 0x9B) | LOUINT16(nParam2)= | LocalError |
  3301. | | LOUINT16 (nParam1)=ss_operations | LocalErrorCode | |
  3302. | | (SS_GetCallBarringPassword = 18) | | |
  3303. +-------+------------------------------------+---------------------+------------------+
  3304. | | HIUINT16= ss_code | | |
  3305. | | (ss_AllBarringSS=0x90, | | |
  3306. | | ss_BarringOfOutgoingCalls=0x91, | | |
  3307. | | ss_BAOC=0x92,ss_BOIC=0x93, | | |
  3308. | | ss_BOIC_ExHC = 0x94, | | |
  3309. | | ss_BarringOfIncomingCalls=0x99, | HIUINT16(nParam2)=0 | Nwk returned a |
  3310. | 0xFB | ss_BAIC = 0x9A,ss_BIC_ROAM = 0x9B) | LOUINT16(nParam2)= | return error |
  3311. | | LOUINT16 (nParam1)=ss_operations | NWErrorCode | |
  3312. | | (SS_GetCallBarringPassword = 18) | | |
  3313. +-------+------------------------------------+---------------------+------------------+
  3314. | | HIUINT16= ss_code | | |
  3315. | | (ss_AllBarringSS=0x90, | | |
  3316. | | ss_BarringOfOutgoingCalls=0x91, | | |
  3317. | | ss_BAOC=0x92,ss_BOIC=0x93, | | |
  3318. | | ss_BOIC_ExHC = 0x94, | HIUINT16(nParam2)= | |
  3319. | | ss_BarringOfIncomingCalls=0x99, | ProblemCodeTag | NW returned a |
  3320. | 0xFC | ss_BAIC = 0x9A,ss_BIC_ROAM = 0x9B) | LOUINT16(nParam2)= | reject component |
  3321. | | LOUINT16 (nParam1)=ss_operations | ProblemCode | |
  3322. | | (SS_GetCallBarringPassword = 18) | | |
  3323. +-------+------------------------------------+---------------------+------------------+
  3324. | | HIUINT16= ss_code | | |
  3325. | | (ss_AllBarringSS=0x90, | | |
  3326. | | ss_BarringOfOutgoingCalls=0x91, | | |
  3327. | | ss_BAOC=0x92,ss_BOIC=0x93, | | |
  3328. | | ss_BOIC_ExHC = 0x94, | | |
  3329. | | ss_BarringOfIncomingCalls=0x99, | HIUINT16(nParam2)=0 | Nwk returned a |
  3330. | 0xFD | ss_BAIC = 0x9A,ss_BIC_ROAM = 0x9B) | LOUINT16(nParam2)= | Cause IE |
  3331. | | LOUINT16 (nParam1)=ss_operations | causevalue | |
  3332. | | (SS_GetCallBarringPassword = 18) | | |
  3333. +-------+------------------------------------+---------------------+------------------+
  3334. \endrst
  3335. \param [in] nFac Specify the facility to check its status. The facility type can be one of the following value:
  3336. \rst
  3337. +---------------------+--------+---------------------------------------------------------------------+
  3338. | Facility type | Value | Description |
  3339. +=====================+========+=====================================================================+
  3340. | CFW_STY_FAC_TYPE_AO | 0x414F | BAOC (Bar All Outgoing Calls) |
  3341. +---------------------+--------+---------------------------------------------------------------------+
  3342. | CFW_STY_FAC_TYPE_OI | 0x4F49 | BOIC (Bar Outgoing International Cal |
  3343. +---------------------+--------+---------------------------------------------------------------------+
  3344. | CFW_STY_FAC_TYPE_OX | 0x4F58 | BOIC-exHC (Bar Outgoing International Calls except to Home Country) |
  3345. +---------------------+--------+---------------------------------------------------------------------+
  3346. | CFW_STY_FAC_TYPE_AI | 0x4149 | BAIC (Bar All Incoming Calls) |
  3347. +---------------------+--------+---------------------------------------------------------------------+
  3348. | CFW_STY_FAC_TYPE_IR | 0x4952 | BIC-Roam (Bar Incoming Calls when Roaming outside the home country) |
  3349. +---------------------+--------+---------------------------------------------------------------------+
  3350. \endrst
  3351. \param [in] nClass Specify the sum of class to represent the class information which show below: See MMI Service Code For more
  3352. \rst
  3353. +-------+------------------------------------+
  3354. | Class | Description |
  3355. +=======+====================================+
  3356. | 11 | Telephony, voice service. |
  3357. +-------+------------------------------------+
  3358. | 13 | Facsimile services |
  3359. +-------+------------------------------------+
  3360. | 16 | Short Message Services |
  3361. +-------+------------------------------------+
  3362. | 20 | All bearer services, data service. |
  3363. +-------+------------------------------------+
  3364. \endrst
  3365. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  3366. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  3367. module. This parameter should be less than 255 for all upper layer application.
  3368. \param [in] nSimID SIM ID
  3369. \return
  3370. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  3371. \rst
  3372. +----------------------------+-----------------------------------------+
  3373. | Error Code | Description |
  3374. +============================+=========================================+
  3375. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  3376. +----------------------------+-----------------------------------------+
  3377. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  3378. +----------------------------+-----------------------------------------+
  3379. | ERR_CME_MEMORY_FULL | No any more memory to allocate |
  3380. +----------------------------+-----------------------------------------+
  3381. \endrst
  3382. */
  3383. uint32_t CFW_SsQueryFacilityLock(
  3384. uint16_t nFac,
  3385. uint8_t nClass,
  3386. uint16_t nUTI,
  3387. CFW_SIM_ID nSimID);
  3388. /*! \brief The CFW_SsChangePassword function unlocks the call barring.
  3389. The result should be returned through the EV_CFW_SS_CHANGE_PWD_RSP event:
  3390. \rst
  3391. +-------+-----------------------------------+---------------------+------------------+
  3392. | nType | nParam1 | nParam2 | Description |
  3393. +=======+===================================+=====================+==================+
  3394. | 0x00 | 0 | 0 | OK |
  3395. +-------+-----------------------------------+---------------------+------------------+
  3396. | | HIUINT16(nParam1)= | | |
  3397. | | ss_code(ss_AllBarringSS = 0x90) | | |
  3398. | | ss_BarringOfIncomingCalls=0x99, | HIUINT16(nParam2)=0 | |
  3399. | 0xFA | LOUINT16 (nParam1)= | LOUINT16(nParam2)= | LocalError |
  3400. | | ss_operations(SS_RegisterPassword | LocalErrorCode | |
  3401. | | = 17) | | |
  3402. +-------+-----------------------------------+---------------------+------------------+
  3403. | | HIUINT16(nParam1)= | | |
  3404. | | ss_code(ss_AllBarringSS = 0x90) | | |
  3405. | | ss_BarringOfIncomingCalls=0x99, | HIUINT16(nParam2)=0 | Nwk returned a |
  3406. | 0xFB | LOUINT16 (nParam1)= | LOUINT16(nParam2)= | return error |
  3407. | | ss_operations(SS_RegisterPassword | NWErrorCode | |
  3408. | | = 17) | | |
  3409. +-------+-----------------------------------+---------------------+------------------+
  3410. | | HIUINT16(nParam1)= | | |
  3411. | | ss_code(ss_AllBarringSS = 0x90) | HIUINT16(nParam2)= | |
  3412. | | ss_BarringOfIncomingCalls=0x99, | ProblemCodeTag | NW returned a |
  3413. | 0xFC | LOUINT16 (nParam1)= | LOUINT16(nParam2)= | reject component |
  3414. | | ss_operations(SS_RegisterPassword | ProblemCode | |
  3415. | | = 17) | | |
  3416. +-------+-----------------------------------+---------------------+------------------+
  3417. | | HIUINT16(nParam1)= | | |
  3418. | | ss_code(ss_AllBarringSS = 0x90) | | |
  3419. | | ss_BarringOfIncomingCalls=0x99, | HIUINT16(nParam2)=0 | Nwk returned a |
  3420. | 0xFD | LOUINT16 (nParam1)= | LOUINT16(nParam2)= | Cause IE |
  3421. | | ss_operations(SS_RegisterPassword | causevalue | |
  3422. | | = 17) | | |
  3423. +-------+-----------------------------------+---------------------+------------------+
  3424. \endrst
  3425. \param [in] nFac Specify the facility(call barring) to check its status. The facility type can be one of the following value:
  3426. \rst
  3427. +---------------------+--------+---------------------------------------------------------------------+
  3428. | Facility type | Value | Description |
  3429. +=====================+========+=====================================================================+
  3430. | CFW_STY_FAC_TYPE_AO | 0x414F | BAOC (Bar All Outgoing Calls) |
  3431. +---------------------+--------+---------------------------------------------------------------------+
  3432. | CFW_STY_FAC_TYPE_OI | 0x4F49 | BOIC (Bar Outgoing International Cal |
  3433. +---------------------+--------+---------------------------------------------------------------------+
  3434. | CFW_STY_FAC_TYPE_OX | 0x4F58 | BOIC-exHC (Bar Outgoing International Calls except to Home Country) |
  3435. +---------------------+--------+---------------------------------------------------------------------+
  3436. | CFW_STY_FAC_TYPE_AI | 0x4149 | BAIC (Bar All Incoming Calls) |
  3437. +---------------------+--------+---------------------------------------------------------------------+
  3438. | CFW_STY_FAC_TYPE_IR | 0x4952 | BIC-Roam (Bar Incoming Calls when Roaming outside the home country) |
  3439. +---------------------+--------+---------------------------------------------------------------------+
  3440. | CFW_STY_FAC_TYPE_AB | 0x4142 | All Barring services |
  3441. +---------------------+--------+---------------------------------------------------------------------+
  3442. | CFW_STY_FAC_TYPE_AG | 0x4147 | All outGoing barring services |
  3443. +---------------------+--------+---------------------------------------------------------------------+
  3444. | CFW_STY_FAC_TYPE_AC | 0x4143 | All inComing barring services |
  3445. +---------------------+--------+---------------------------------------------------------------------+
  3446. \endrst
  3447. \param [in] pBufOldPwd Point to the buffer containing the password in ASCII string format for the facility. This parameter can be ignored
  3448. if no old password was allocated to the facility.Take into account that a password may have already been set by factory, or that the
  3449. service is subject to a password issued by the provider.if nFac = CFW_STY_FAC_TYPE_AO ..CFW_STY_FAC_TYPE_AC (barring) then network password(if needed)
  3450. \param [in] nOldPwdSize The size of pBufPwdin bytes. If pBufPwd is NULL, this parameter is ignored by this function.
  3451. \param [in] pBufNewPwd Point to the buffer containing the new password in ASCII string format.
  3452. \param [in] nNewPwdSize The size of pBufPwdin bytes.
  3453. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  3454. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  3455. module. This parameter should be less than 255 for all upper layer application.
  3456. \param [in] nSimID SIM ID
  3457. \return
  3458. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  3459. \rst
  3460. +-------------------------------+---------------------------------------------------------+
  3461. | Error Code | Description |
  3462. +===============================+=========================================================+
  3463. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  3464. +-------------------------------+---------------------------------------------------------+
  3465. | | This function don't complete, and you execute the same |
  3466. | ERR_CME_OPERATION_NOT_ALLOWED | operations such as call this function again. |
  3467. +-------------------------------+---------------------------------------------------------+
  3468. \endrst
  3469. */
  3470. uint32_t CFW_SsChangePassword(
  3471. uint16_t nFac,
  3472. uint8_t *pBufOldPwd,
  3473. uint8_t nOldPwdSize,
  3474. uint8_t *pBufNewPwd,
  3475. uint8_t nNewPwdSize,
  3476. uint16_t nUTI,
  3477. CFW_SIM_ID nSimID);
  3478. /*! \brief The CFW_SsQueryClip function querys the Calling line identification presentation
  3479. The result should be returned through the EV_CFW_SS_QUERY_CLIP_RSP event:
  3480. \rst
  3481. +-------+-----------------------------------+-------------------------------+------------------+
  3482. | nType | nParam1 | nParam2 | Description |
  3483. +=======+===================================+===============================+==================+
  3484. | | | Specify the parameter shows | |
  3485. | | 0 means don't presentation | the subscriber CLIP service | |
  3486. | | of the CLIP | status in the network: | |
  3487. | 0x00 | 1: indicate presentation | 0:CLIP not provisioned | Interrogation OK |
  3488. | | of the CLIP | 1:CLIP provisioned in | |
  3489. | | | 2.unknown | |
  3490. +-------+-----------------------------------+-------------------------------+------------------+
  3491. | | HIUINT16(nParam1)= | | |
  3492. | | ss_code(ss_CLIP = 0x11) | HIUINT16(nParam2)=0 | |
  3493. | 0xFA | LOUINT16 (nParam1)= | LOUINT16(nParam2)= | LocalError |
  3494. | | ss_operations(SS_Interrogate= 14) | LocalErrorCode | |
  3495. +-------+-----------------------------------+-------------------------------+------------------+
  3496. | | HIUINT16(nParam1)= | | |
  3497. | | ss_code(ss_CLIP = 0x11) | HIUINT16(nParam2)=0 | Nwk returned a |
  3498. | 0xFB | LOUINT16 (nParam1)= | LOUINT16(nParam2)=NWErrorCode | return error |
  3499. | | ss_operations(SS_Interrogate= 14) | | |
  3500. +-------+-----------------------------------+-------------------------------+------------------+
  3501. | | HIUINT16(nParam1)= | | |
  3502. | | ss_code(ss_CLIP = 0x11) | HIUINT16(nParam2)= | |
  3503. | | LOUINT16 (nParam1)= | ProblemCodeTag | NW returned a |
  3504. | 0xFC | ss_operations(SS_Interrogate= 14) | LOUINT16(nParam2)=ProblemCode | reject component |
  3505. +-------+-----------------------------------+-------------------------------+------------------+
  3506. | | HIUINT16(nParam1)= | | |
  3507. | | ss_code(ss_CLIP = 0x11) | HIUINT16(nParam2)=0 | Nwk returned a |
  3508. | 0xFD | LOUINT16 (nParam1)= | LOUINT16(nParam2)=causevalue | Cause IE |
  3509. | | ss_operations(SS_Interrogate= 14) | | |
  3510. +-------+-----------------------------------+-------------------------------+------------------+
  3511. \endrst
  3512. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  3513. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  3514. module. This parameter should be less than 255 for all upper layer application.
  3515. \param [in] nSimID SIM ID
  3516. \return
  3517. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  3518. \rst
  3519. +----------------------------+------------------------------------------------------------------+
  3520. | Error Code | Description |
  3521. +============================+==================================================================+
  3522. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  3523. +----------------------------+------------------------------------------------------------------+
  3524. | | Indicates the event could not be immediately placed in the queue |
  3525. | ERR_COS_QUEUE_FULL | because there was not enough space available, so this function |
  3526. | | fail to send event to CFW. |
  3527. +----------------------------+------------------------------------------------------------------+
  3528. | ERR_CME_UNKNOWN | Unknown error occur. |
  3529. +----------------------------+------------------------------------------------------------------+
  3530. \endrst
  3531. */
  3532. uint32_t CFW_SsQueryClip(
  3533. uint16_t nUTI,
  3534. CFW_SIM_ID nSimID);
  3535. /*! \brief The CFW_SsQueryClir function allows to query the status which a calling subscriber enable or disable the presentation of the CLI to the called party when originating a call.
  3536. The result should be returned through one of the EV_CFW_SS_QUERY_CLIR_RSP event:
  3537. \rst
  3538. +-------+-----------------------------------+-------------------------------+------------------+
  3539. | nType | nParam1 | nParam2 | Description |
  3540. +=======+===================================+===============================+==================+
  3541. | | Specify the parameter the | Specify the parameter shows | |
  3542. | | adjustment for outgoing calls: | the subscriber CLIR service | |
  3543. | | 0:Presentation indicator is used | status in the network: | |
  3544. | | according to the subscription of | 0:CLIR not provisioned | |
  3545. | 0x00 | the CLIR service. | 1:CLIR provisioned in | OK |
  3546. | | 1:CLIR invocation. Activate CLIR. | permanent mode 2.unknown | |
  3547. | | Disable presentation of own phon | 3.temporary mode presentation | |
  3548. | | number to called party. | restricted 4.CLIR temporary | |
  3549. | | | mode presentation allowed | |
  3550. +-------+-----------------------------------+-------------------------------+------------------+
  3551. | | HIUINT16(nParam1)= | | |
  3552. | | ss_code(ss_CLIR = 0x12) | HIUINT16(nParam2)=0 | |
  3553. | 0xFA | LOUINT16 (nParam1)= | LOUINT16(nParam2)= | LocalError |
  3554. | | ss_operations(SS_Interrogate= 14) | LocalErrorCode | |
  3555. +-------+-----------------------------------+-------------------------------+------------------+
  3556. | | HIUINT16(nParam1)= | | |
  3557. | | ss_code(ss_CLIR = 0x12) | HIUINT16(nParam2)=0 | Nwk returned a |
  3558. | 0xFB | LOUINT16 (nParam1)= | LOUINT16(nParam2)=NWErrorCode | return error |
  3559. | | ss_operations(SS_Interrogate= 14) | | |
  3560. +-------+-----------------------------------+-------------------------------+------------------+
  3561. | | HIUINT16(nParam1)= | | |
  3562. | | ss_code(ss_CLIR = 0x12) | HIUINT16(nParam2)= | |
  3563. | | LOUINT16 (nParam1)= | ProblemCodeTag | NW returned a |
  3564. | 0xFC | ss_operations(SS_Interrogate= 14) | LOUINT16(nParam2)=ProblemCode | reject component |
  3565. +-------+-----------------------------------+-------------------------------+------------------+
  3566. | | HIUINT16(nParam1)= | | |
  3567. | | ss_code(ss_CLIR = 0x12) | HIUINT16(nParam2)=0 | Nwk returned a |
  3568. | 0xFD | LOUINT16 (nParam1)= | LOUINT16(nParam2)=causevalue | Cause IE |
  3569. | | ss_operations(SS_Interrogate= 14) | | |
  3570. +-------+-----------------------------------+-------------------------------+------------------+
  3571. \endrst
  3572. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  3573. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  3574. module. This parameter should be less than 255 for all upper layer application.
  3575. \param [in] nSimID SIM ID
  3576. \return
  3577. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  3578. \rst
  3579. +----------------------------+------------------------------------------------------------------+
  3580. | Error Code | Description |
  3581. +============================+==================================================================+
  3582. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  3583. +----------------------------+------------------------------------------------------------------+
  3584. | | Indicates the event could not be immediately placed in the queue |
  3585. | ERR_COS_QUEUE_FULL | because there was not enough space available, so this function |
  3586. | | fail to send event to CFW. |
  3587. +----------------------------+------------------------------------------------------------------+
  3588. | ERR_CME_UNKNOWN | Unknown error occur. |
  3589. +----------------------------+------------------------------------------------------------------+
  3590. \endrst
  3591. */
  3592. uint32_t CFW_SsQueryClir(
  3593. uint16_t nUTI,
  3594. CFW_SIM_ID nSimID);
  3595. /*! \brief The CFW_SsQueryColp function retrieves the setting of the Connected Line Identification Presentation (COLP) of the called party after setting up a mobile originated call. See 3GPP TS 22.081 [3] for more.
  3596. The result should be returned through the EV_CFW_SS_QUERY_COLP_RSP event:
  3597. \rst
  3598. +-------+-----------------------------------+-------------------------------+------------------+
  3599. | nType | nParam1 | nParam2 | Description |
  3600. +=======+===================================+===============================+==================+
  3601. | | | 0:COLP not provisioned | |
  3602. | 0x00 | 0: Disable to show the COLP | 1:COLP provisioned in | Interrogation OK |
  3603. | | 1: Enable to show the COLP | 2.unknown | |
  3604. +-------+-----------------------------------+-------------------------------+------------------+
  3605. | | HIUINT16(nParam1)= | | |
  3606. | | ss_code(ss_COLP = 0x13) | HIUINT16(nParam2)=0 | |
  3607. | 0xFA | LOUINT16 (nParam1)= | LOUINT16(nParam2)= | LocalError |
  3608. | | ss_operations(SS_Interrogate= 14) | LocalErrorCode | |
  3609. +-------+-----------------------------------+-------------------------------+------------------+
  3610. | | HIUINT16(nParam1)= | | |
  3611. | | ss_code(ss_COLP = 0x13) | HIUINT16(nParam2)=0 | Nwk returned a |
  3612. | 0xFB | LOUINT16 (nParam1)= | LOUINT16(nParam2)=NWErrorCode | return error |
  3613. | | ss_operations(SS_Interrogate= 14) | | |
  3614. +-------+-----------------------------------+-------------------------------+------------------+
  3615. | | HIUINT16(nParam1)= | | |
  3616. | | ss_code(ss_COLP = 0x13) | HIUINT16(nParam2)= | |
  3617. | | LOUINT16 (nParam1)= | ProblemCodeTag | NW returned a |
  3618. | 0xFC | ss_operations(SS_Interrogate= 14) | LOUINT16(nParam2)=ProblemCode | reject component |
  3619. +-------+-----------------------------------+-------------------------------+------------------+
  3620. | | HIUINT16(nParam1)= | | |
  3621. | | ss_code(ss_COLP = 0x13) | HIUINT16(nParam2)=0 | Nwk returned a |
  3622. | 0xFD | LOUINT16 (nParam1)= | LOUINT16(nParam2)=causevalue | Cause IE |
  3623. | | ss_operations(SS_Interrogate= 14) | | |
  3624. +-------+-----------------------------------+-------------------------------+------------------+
  3625. \endrst
  3626. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  3627. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  3628. module. This parameter should be less than 255 for all upper layer application.
  3629. \param [in] nSimID SIM ID
  3630. \return
  3631. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  3632. \rst
  3633. +----------------------------+-----------------------------------------+
  3634. | Error Code | Description |
  3635. +============================+=========================================+
  3636. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  3637. +----------------------------+-----------------------------------------+
  3638. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  3639. +----------------------------+-----------------------------------------+
  3640. | ERR_CME_UNKNOWN | Unknown error occur. |
  3641. +----------------------------+-----------------------------------------+
  3642. | ERR_CME_MEMORY_FULL | No any more memory to allocate |
  3643. +----------------------------+-----------------------------------------+
  3644. \endrst
  3645. */
  3646. uint32_t CFW_SsQueryColp(
  3647. uint16_t nUTI,
  3648. CFW_SIM_ID nSimID);
  3649. /*! \brief The CFW_SsQueryColr function retrieves the status of the Connected Line Identification Restriction (COLR) of the called party after setting up a mobile originated call.
  3650. The result should be returned through the EV_CFW_SS_QUERY_COLR_RSP event:
  3651. \rst
  3652. +-------+-----------------------------------+-------------------------------+------------------+
  3653. | nType | nParam1 | nParam2 | Description |
  3654. +=======+===================================+===============================+==================+
  3655. | | 0: means don't presentation | 0:COLR not provisioned | |
  3656. | 0x00 | of the COLR. 1:indicate | 1:COLR provisioned in | OK |
  3657. | | presentation of the COLR | 2.unknown | |
  3658. +-------+-----------------------------------+-------------------------------+------------------+
  3659. | | HIUINT16(nParam1)= | | |
  3660. | | ss_code(ss_COLR = 0x14) | HIUINT16(nParam2)=0 | |
  3661. | 0xFA | LOUINT16 (nParam1)= | LOUINT16(nParam2)= | LocalError |
  3662. | | ss_operations(SS_Interrogate= 14) | LocalErrorCode | |
  3663. +-------+-----------------------------------+-------------------------------+------------------+
  3664. | | HIUINT16(nParam1)= | | |
  3665. | | ss_code(ss_COLR = 0x14) | HIUINT16(nParam2)=0 | Nwk returned a |
  3666. | 0xFB | LOUINT16 (nParam1)= | LOUINT16(nParam2)=NWErrorCode | return error |
  3667. | | ss_operations(SS_Interrogate= 14) | | |
  3668. +-------+-----------------------------------+-------------------------------+------------------+
  3669. | | HIUINT16(nParam1)= | | |
  3670. | | ss_code(ss_COLR = 0x14) | HIUINT16(nParam2)= | |
  3671. | | LOUINT16 (nParam1)= | ProblemCodeTag | NW returned a |
  3672. | 0xFC | ss_operations(SS_Interrogate= 14) | LOUINT16(nParam2)=ProblemCode | reject component |
  3673. +-------+-----------------------------------+-------------------------------+------------------+
  3674. | | HIUINT16(nParam1)= | | |
  3675. | | ss_code(ss_COLR = 0x14) | HIUINT16(nParam2)=0 | Nwk returned a |
  3676. | 0xFD | LOUINT16 (nParam1)= | LOUINT16(nParam2)=causevalue | Cause IE |
  3677. | | ss_operations(SS_Interrogate= 14) | | |
  3678. +-------+-----------------------------------+-------------------------------+------------------+
  3679. \endrst
  3680. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  3681. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  3682. module. This parameter should be less than 255 for all upper layer application.
  3683. \param [in] nSimID SIM ID
  3684. \return
  3685. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  3686. \rst
  3687. +----------------------------+------------------------------------------------------------------+
  3688. | Error Code | Description |
  3689. +============================+==================================================================+
  3690. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  3691. +----------------------------+------------------------------------------------------------------+
  3692. | | Indicates the event could not be immediately placed in the queue |
  3693. | ERR_COS_QUEUE_FULL | because there was not enough space available, so this function |
  3694. | | fail to send event to CFW. |
  3695. +----------------------------+------------------------------------------------------------------+
  3696. | ERR_CME_UNKNOWN | Unknown error occur. |
  3697. +----------------------------+------------------------------------------------------------------+
  3698. \endrst
  3699. */
  3700. uint32_t CFW_SsQueryColr(
  3701. uint16_t nUTI,
  3702. CFW_SIM_ID nSimID);
  3703. /*! \brief The CFW_SsSendUSSD function controls the Unstructured Supplementary Service Data (USSD) according to 3GPP TS 23.090. Both network and mobile initiated operations are supported
  3704. The result should be returned through the EV_CFW_SS_QUERY_CLIP_RSP event:
  3705. \rst
  3706. +-------+-------------------------------------+-------------------------------+------------------+
  3707. | nType | nParam1 | nParam2 | Description |
  3708. +=======+=====================================+===============================+==================+
  3709. | | Specify the CFW_SS_USSD_IND_INFO | Specify the parameter shows | |
  3710. | 0x00 | structure. | Specify ss_code(ussd_v1= | OK |
  3711. | | If nOption==2 nParam1 is NULL. | 0x101,ussd_v2=0x100) | |
  3712. +-------+-------------------------------------+-------------------------------+------------------+
  3713. | | HIUINT16(nParam1)= ss_code | | |
  3714. | | (ussd_v1=0x101,ussd_v2=0x100) | HIUINT16(nParam2)=0 | |
  3715. | 0xFA | LOUINT16 (nParam1)=ss_operations | LOUINT16(nParam2)= | LocalError |
  3716. | | (ProcessUnstructuredSSData = 19, | | |
  3717. | | SS_ProcessUnstructuredSSRequest=59, | | |
  3718. | | SS_UnstructuredSSRequest = 60, | | |
  3719. | | SS_UnstructuredSSNotify = 61) | | |
  3720. +-------+-------------------------------------+-------------------------------+------------------+
  3721. | | HIUINT16(nParam1)= ss_code | | |
  3722. | | (ussd_v1=0x101,ussd_v2=0x100) | HIUINT16(nParam2)=0 | Nwk returned a |
  3723. | 0xFB | LOUINT16 (nParam1)=ss_operations | LOUINT16(nParam2)=NWErrorCode | return error |
  3724. | | (ProcessUnstructuredSSData = 19, | | |
  3725. | | SS_ProcessUnstructuredSSRequest=59, | | |
  3726. | | SS_UnstructuredSSRequest = 60, | | |
  3727. | | SS_UnstructuredSSNotify = 61) | | |
  3728. +-------+-------------------------------------+-------------------------------+------------------+
  3729. | | HIUINT16(nParam1)= ss_code | | |
  3730. | | (ussd_v1=0x101,ussd_v2=0x100) | HIUINT16(nParam2)= | |
  3731. | | LOUINT16 (nParam1)=ss_operations | ProblemCodeTag | NW returned a |
  3732. | 0xFC | (ProcessUnstructuredSSData = 19, | LOUINT16(nParam2)=ProblemCode | reject component |
  3733. | | SS_ProcessUnstructuredSSRequest=59, | | |
  3734. | | SS_UnstructuredSSRequest = 60, | | |
  3735. | | SS_UnstructuredSSNotify = 61) | | |
  3736. +-------+-------------------------------------+-------------------------------+------------------+
  3737. | | HIUINT16(nParam1)= ss_code | | |
  3738. | | (ussd_v1=0x101,ussd_v2=0x100) | HIUINT16(nParam2)=0 | Nwk returned a |
  3739. | 0xFD | LOUINT16 (nParam1)=ss_operations | LOUINT16(nParam2)=causevalue | Cause IE |
  3740. | | (ProcessUnstructuredSSData = 19, | | |
  3741. | | SS_ProcessUnstructuredSSRequest=59, | | |
  3742. | | SS_UnstructuredSSRequest = 60, | | |
  3743. | | SS_UnstructuredSSNotify = 61) | | |
  3744. +-------+-------------------------------------+-------------------------------+------------------+
  3745. \endrst
  3746. \param [in] pUsdString Specify the string type USSD-string, this parameter should be encoded according to the parameter nDcs. If this parameter is NULL, network is not interrogated.(其他应用参见 nOption)
  3747. \param [in] nUsdStringSize Specify the string type USSD-string size in bytes, ranged from 1 to 160. If pUsdString is NULL, this parameter is ignored. (其他应用参见 nOption)
  3748. \param [in] nOption Specify the result code. This parameter can be one of the following value:
  3749. \rst
  3750. +-------+--------------------------------------------------------------------------------------+
  3751. | Value | Description |
  3752. +=======+======================================================================================+
  3753. | | MS 返回 Error(nUsdStringSize标识 Errsource , pUsdString[0]标识具体的 ErrCode); |
  3754. | 0 | USSD version 2 operation |
  3755. +-------+--------------------------------------------------------------------------------------+
  3756. | | MS返回拒绝 (nUsdStringSize标识 ProblemCodeTag ,pUsdString[0]标识具体的 ProblemCode) |
  3757. | 1 | USSD version 2 operation. |
  3758. +-------+--------------------------------------------------------------------------------------+
  3759. | 2 | terminate the session(release complete); USSD version 2 operation. |
  3760. +-------+--------------------------------------------------------------------------------------+
  3761. | 3 | MS发起 ussd 或返回网络发起的 ussd 操作;USSD version 2 operation. |
  3762. +-------+--------------------------------------------------------------------------------------+
  3763. | | |
  3764. | | MS 返回 Error(nUsdStringSize标识 Errsource, pUsdString[0]标识具体的 ErrCode );USSD |
  3765. | 128 | version 1 operation.(The string must be encoded as an IA5 string, nDcs is ignored) |
  3766. +-------+--------------------------------------------------------------------------------------+
  3767. | | MS返回拒绝(nUsdStringSize标识 ProblemCodeTag, pUsdString[0]标识具体的 ProblemCode); |
  3768. | 129 | USSD version 1 operationThe string must be encoded as an IA5 string, nDcs is ignored |
  3769. +-------+--------------------------------------------------------------------------------------+
  3770. | | |
  3771. | | terminate the session(release complete); USSD version 1 operation. |
  3772. | 130 | (The string must be encoded as an IA5 string, nDcs is ignored) |
  3773. +-------+--------------------------------------------------------------------------------------+
  3774. | | MS发起ussd或返回网络发起的ussd操作; USSD version 1 operation. |
  3775. | 131 | (The string must be encoded as an IA5 string, nDcs is ignored) |
  3776. +-------+--------------------------------------------------------------------------------------+
  3777. \endrst
  3778. \param [in] nDcs The USSD data coding scheme. Specify the 3GPP TS 23.038 [25] Cell Broadcast Data Coding Scheme in integer format.Specify the file in integer format.
  3779. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  3780. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  3781. module. This parameter should be less than 255 for all upper layer application.
  3782. \param [in] nSimID SIM ID
  3783. \return
  3784. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  3785. \rst
  3786. +-------------------------------+--------------------------------------------------------+
  3787. | Error Code | Description |
  3788. +===============================+========================================================+
  3789. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  3790. +-------------------------------+--------------------------------------------------------+
  3791. | | This function don't complete, and you execute the same |
  3792. | ERR_CME_OPERATION_NOT_ALLOWED | operations such as call this function again. |
  3793. | | or there is some other SS operations exist. |
  3794. +-------------------------------+--------------------------------------------------------+
  3795. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  3796. +-------------------------------+--------------------------------------------------------+
  3797. | ERR_CME_UNKNOWN | Unknown error occur. |
  3798. +-------------------------------+--------------------------------------------------------+
  3799. \endrst
  3800. */
  3801. uint32_t CFW_SsSendUSSD(
  3802. uint8_t *pUsdString,
  3803. uint8_t nUsdStringSize,
  3804. uint8_t nOption,
  3805. uint8_t nDcs,
  3806. uint16_t nUTI,
  3807. CFW_SIM_ID nSimID);
  3808. uint32_t CFW_SsSendUSSD_V2(
  3809. uint8_t *pUsdString,
  3810. uint8_t nUsdStringSize,
  3811. uint8_t nOption,
  3812. uint8_t nDcs,
  3813. uint16_t nUTI,
  3814. uint16_t nTI,
  3815. CFW_SIM_ID nSimID);
  3816. typedef struct _CFW_SS_USSD_IND_INFO
  3817. {
  3818. uint8_t *pUsdString;
  3819. uint8_t nStingSize;
  3820. uint8_t nOption;
  3821. uint8_t nDcs;
  3822. uint8_t padding;
  3823. } CFW_SS_USSD_IND_INFO;
  3824. typedef struct _CFW_SS_USSD_IND_INFO_V2
  3825. {
  3826. uint8_t pUsdString[255];
  3827. uint8_t nStingSize;
  3828. uint8_t nOption;
  3829. uint8_t nDcs;
  3830. uint8_t padding;
  3831. } CFW_SS_USSD_IND_INFO_V2;
  3832. //
  3833. // SIM Service
  3834. //
  3835. typedef struct _CFW_SAT_RESPONSE
  3836. {
  3837. uint8_t nSm_Act_prevStatus;
  3838. uint8_t nSm_Act_currStatus;
  3839. uint8_t nSAT_Mode;
  3840. uint8_t nSm_Resp_prevStatus;
  3841. uint8_t nSm_Resp_currStatus;
  3842. uint8_t nSAT_CmdType;
  3843. uint8_t nSAT_Status; ///< command status
  3844. uint8_t nSAT_ItemID;
  3845. uint8_t nSAT_InnerProcess;
  3846. uint8_t nSAT_InputSch; ///< text code scheme.
  3847. uint16_t nSAT_InputLen; ///< text length
  3848. uint32_t padding; ///< DON'T remove this byte, because the next member nSAT_InputStr should be aligned 4 bytes, it'll convert to a pointer.
  3849. uint8_t nSAT_InputStr[0];
  3850. } CFW_SAT_RESPONSE;
  3851. typedef struct _CFW_SAT_TERMINAL_ENVELOPE_CNF
  3852. {
  3853. uint16_t SW;
  3854. uint8_t Pid;
  3855. uint8_t Dcs;
  3856. uint8_t NbByte; // Nb of byte of the response
  3857. uint8_t ResponseData[256];
  3858. } CFW_SAT_TERMINAL_ENVELOPE_CNF;
  3859. typedef struct _SAT_CHSTATUS_RSP
  3860. {
  3861. uint8_t nChannelID; ///< 1..7
  3862. uint8_t nStatus; ///< 0: Link not established or PDP context not activated
  3863. // 1: Link established or PDP context activated
  3864. //
  3865. uint8_t nType; ///< 00 : No further info can be given
  3866. //05 : Link dropped
  3867. } SAT_CHSTATUS_RSP;
  3868. typedef struct _SAT_BASE_RSP ///< for proactive command 26
  3869. {
  3870. uint8_t nComID; ///< Command id
  3871. uint8_t nComQualifier; ///< Command Qualifier
  3872. } SAT_BASE_RSP;
  3873. typedef struct _SAT_LOCALINFO_RSP
  3874. {
  3875. uint8_t nMCC_MNC_Code[6]; ///< BCD code ,example:4,6,0,0,0,F for china mobile
  3876. uint16_t nLocalAreaCode; ///< Hex Local area code
  3877. uint16_t nCellIdentify; ///< Hex Cell identify
  3878. } SAT_LOCALINFO_RSP;
  3879. typedef struct _SAT_IMEI_RSP
  3880. {
  3881. uint8_t nInterMobileId[8]; ///< BCD code,IMEI
  3882. } SAT_IMEI_RSP;
  3883. typedef struct _SAT_MEASURE_RSP
  3884. {
  3885. uint8_t nMeasure[16]; ///< Net work measurement
  3886. } SAT_MEASURE_RSP;
  3887. typedef struct _SAT_DATETIME_RSP
  3888. {
  3889. uint8_t nDateTimeZone[7]; ///< Date,Time,Zone
  3890. } SAT_DATETIME_RSP;
  3891. typedef struct _SAT_LANGUAGE_RSP
  3892. {
  3893. uint8_t nLanguageCode[2]; ///< Language
  3894. } SAT_LANGUAGE_RSP;
  3895. typedef struct _SAT_TIMINGADV_RSP
  3896. {
  3897. uint8_t nME_Status; ///< Me status
  3898. uint8_t nTimingAdv; ///< Timing advance
  3899. } SAT_TIMINGADV_RSP;
  3900. typedef struct _CFW_SAT_SMS_RSP ///< for proactive command 0x13
  3901. {
  3902. uint8_t nComID;
  3903. uint8_t nComQualifier;
  3904. uint16_t nAlphaLen;
  3905. uint8_t *pAlphaStr;
  3906. uint16_t nAddrLen;
  3907. uint8_t nAddrType;
  3908. uint8_t *pAddrStr;
  3909. uint8_t nPDULen;
  3910. uint8_t *pPDUStr;
  3911. } CFW_SAT_SMS_RSP;
  3912. typedef struct _CFW_SAT_SMS_RSP_V2 ///< for proactive command 0x13
  3913. {
  3914. uint8_t nComID;
  3915. uint8_t nComQualifier;
  3916. uint16_t nAlphaLen;
  3917. uint8_t pAlphaStr[CFW_SAT_MAX_ALPHA_STR_LEN];
  3918. uint16_t nAddrLen;
  3919. uint8_t nAddrType;
  3920. uint8_t pAddrStr[CFW_SAT_MAX_ADDR_LEN];
  3921. uint8_t nPDULen;
  3922. uint8_t pPDUStr[CFW_MAX_SMS_PDU_LEN];
  3923. } CFW_SAT_SMS_RSP_V2;
  3924. typedef struct _CFW_SAT_DTEXT_RSP_V2 ///< for proactive command 0x21
  3925. {
  3926. uint8_t nComID;
  3927. uint8_t nComQualifier;
  3928. uint8_t nTextLen;
  3929. uint8_t nTextSch;
  3930. uint8_t pTextStr[CFW_SAT_MAX_TEXT_STR_LEN];
  3931. } CFW_SAT_DTEXT_RSP_V2;
  3932. typedef struct _CFW_SAT_INPUT_RSP_V2 ///< for proactive command 0x23
  3933. {
  3934. uint8_t nComID;
  3935. uint8_t nComQualifier;
  3936. uint8_t nTextLen;
  3937. uint8_t nTextSch;
  3938. uint8_t pTextStr[CFW_SAT_MAX_TEXT_STR_LEN];
  3939. uint8_t nResMinLen;
  3940. uint8_t nResMaxLen;
  3941. uint8_t nDefTextLen;
  3942. uint8_t nDefTextSch;
  3943. uint8_t pDefTextStr[CFW_SAT_MAX_TEXT_STR_LEN];
  3944. } CFW_SAT_INPUT_RSP_V2;
  3945. typedef struct _CFW_SAT_INKEY_RSP_V2 ///< for proactive command 0x23
  3946. {
  3947. uint8_t nComID;
  3948. uint8_t nComQualifier;
  3949. uint8_t nTextLen;
  3950. uint8_t nTextSch;
  3951. uint8_t pTextStr[CFW_SAT_MAX_TEXT_STR_LEN];
  3952. } CFW_SAT_INKEY_RSP_V2;
  3953. typedef struct _CFW_SAT_CALL_RSP_V2 ///< for proactive command 0x10
  3954. {
  3955. uint8_t nComID;
  3956. uint8_t nComQualifier;
  3957. uint16_t nAlphaConfirmLen;
  3958. uint8_t pAlphaConfirmStr[CFW_SAT_MAX_ALPHA_STR_LEN];
  3959. uint8_t nAddrLen;
  3960. uint8_t nAddrType;
  3961. uint8_t pAddrStr[CFW_SAT_MAX_ADDR_LEN];
  3962. uint8_t nCapabilityCfgLen;
  3963. uint8_t pCapabilityCfgStr[CFW_SAT_MAX_TEXT_STR_LEN];
  3964. uint8_t nSubAddrLen;
  3965. uint8_t pSubAddrStr[CFW_SAT_MAX_ADDR_LEN];
  3966. uint8_t nTuint;
  3967. uint8_t nTinterval;
  3968. uint16_t nAlphaSetupLen;
  3969. uint8_t pAlphaSetupStr[CFW_SAT_MAX_ALPHA_STR_LEN];
  3970. } CFW_SAT_CALL_RSP_V2;
  3971. typedef struct _CFW_SAT_SS_RSP_V2 ///< for proactive command 0x10
  3972. {
  3973. uint8_t nComID;
  3974. uint8_t nComQualifier;
  3975. uint8_t nAlphaLength;
  3976. uint8_t nAlphaIdentifier[CFW_SAT_MAX_ALPHA_STR_LEN];
  3977. uint8_t nIconQualifier;
  3978. uint8_t nIconIdentifier;
  3979. uint8_t nSSLength;
  3980. uint8_t nTONNPI;
  3981. uint8_t pSSStr[CFW_SAT_MAX_SS_STR_LEN];
  3982. } CFW_SAT_SS_RSP_V2;
  3983. typedef struct _CFW_SAT_USSD_RSP_V2 ///< for proactive command 0x10
  3984. {
  3985. uint8_t nComID;
  3986. uint8_t nComQualifier;
  3987. uint8_t nAlphaLength;
  3988. uint8_t nAlphaIdentifier[CFW_SAT_MAX_ALPHA_STR_LEN];
  3989. uint8_t nIconQualifier;
  3990. uint8_t nIconIdentifier;
  3991. uint8_t nUSSDLength;
  3992. uint8_t nCodeScheme;
  3993. uint8_t pUSSDStr[CFW_SAT_MAX_USSD_STR_LEN];
  3994. } CFW_SAT_USSD_RSP_V2;
  3995. typedef struct _CFW_SAT_FILELIST_RSP_V2 ///< for proactive command 0x10
  3996. {
  3997. uint8_t nComID;
  3998. uint8_t nComQualifier;
  3999. uint8_t nMode;
  4000. uint8_t nNumFiles;
  4001. uint8_t nFiles[CFW_SAT_MAX_FILE_LIST_LEN];
  4002. } CFW_SAT_FILELIST_RSP_V2;
  4003. typedef struct _CFW_SAT_PLAYTONE_RSP_V2
  4004. {
  4005. uint8_t nComID;
  4006. uint8_t nComQualifier;
  4007. uint8_t TimeUnit;
  4008. uint8_t TimeInterval;
  4009. uint8_t Tone;
  4010. uint8_t IconQualifier;
  4011. uint8_t IconIdentifier;
  4012. uint8_t AlphaIDLen;
  4013. uint8_t AlphaIDString[CFW_SAT_MAX_ALPHA_STR_LEN];
  4014. } CFW_SAT_PLAYTONE_RSP_V2;
  4015. #define OPEN_CHANNEL_BEARER_CSD 01
  4016. #define OPEN_CHANNEL_BEARER_GPRS 02
  4017. #define OPEN_CHANNEL_BEARER_DEFAULT 03
  4018. typedef struct _CFW_SAT_OPENCHANNEL_RSP_V2 ///< for proactive command 0x15
  4019. {
  4020. uint8_t nComID;
  4021. uint8_t nComQualifier;
  4022. uint8_t AlphaIdentifierLen;
  4023. uint8_t AlphaIdentifier[CFW_SAT_MAX_ALPHA_STR_LEN];
  4024. uint8_t IconQualifier;
  4025. uint8_t IconIdentifier;
  4026. uint8_t AddressType;
  4027. uint8_t AddressLen;
  4028. uint8_t Address[CFW_SAT_MAX_ADDR_LEN];
  4029. uint8_t SubAddressLen;
  4030. uint8_t SubAddress[CFW_SAT_MAX_ADDR_LEN];
  4031. uint8_t Duration1Unit;
  4032. uint8_t Duration1Interval;
  4033. uint8_t Duration2Unit;
  4034. uint8_t Duration2Interval;
  4035. uint8_t BearerType;
  4036. uint8_t BearerLen;
  4037. uint8_t BearerDescription[CFW_SAT_MAX_BEARER_DESC_LEN];
  4038. uint16_t BufferSize;
  4039. uint8_t OtherAddressLen;
  4040. uint8_t OtherAddressType;
  4041. uint8_t OtherAddress[CFW_SAT_MAX_ADDR_LEN];
  4042. uint8_t UserLoginLen;
  4043. uint8_t UserLoginDcs;
  4044. uint8_t UserLogin[CFW_SAT_MAX_TEXT_STR_LEN];
  4045. uint8_t UserPasswordLen;
  4046. uint8_t UserPasswordDcs;
  4047. uint8_t UserPassword[CFW_SAT_MAX_TEXT_STR_LEN];
  4048. uint8_t TransportLevelType;
  4049. uint16_t TransportLevelPort;
  4050. uint8_t DestAddressLen;
  4051. uint8_t DestAddressType;
  4052. uint8_t DestAddress[CFW_SAT_MAX_ADDR_LEN];
  4053. uint8_t NetworkAccessNameLen;
  4054. uint8_t NetworkAccessName[CFW_SAT_MAX_NW_ACCESS_NAME_LEN];
  4055. } CFW_SAT_OPENCHANNEL_RSP_V2;
  4056. typedef struct _CFW_SAT_CLOSECHANNEL_RSP_V2 ///< for proactive command 0x15
  4057. {
  4058. uint8_t nComID;
  4059. uint8_t nComQualifier;
  4060. uint8_t AlphaIdentifierLen;
  4061. uint8_t AlphaIdentifier[CFW_SAT_MAX_ALPHA_STR_LEN];
  4062. uint8_t IconQualifier;
  4063. uint8_t IconIdentifier;
  4064. } CFW_SAT_CLOSECHANNEL_RSP_V2;
  4065. typedef struct _CFW_SAT_RECEIVEDATA_RSP_V2 ///< for proactive command 0x15
  4066. {
  4067. uint8_t nComID;
  4068. uint8_t nComQualifier;
  4069. uint8_t AlphaIdentifierLen;
  4070. uint8_t AlphaIdentifier[CFW_SAT_MAX_ALPHA_STR_LEN];
  4071. uint8_t IconQualifier;
  4072. uint8_t IconIdentifier;
  4073. uint8_t ChannelDataLength;
  4074. } CFW_SAT_RECEIVEDATA_RSP_V2;
  4075. typedef struct _CFW_SAT_SENDDATA_RSP_V2 ///< for proactive command 0x15
  4076. {
  4077. uint8_t nComID;
  4078. uint8_t nComQualifier;
  4079. uint8_t AlphaIdentifierLen;
  4080. uint8_t AlphaIdentifier[CFW_SAT_MAX_ALPHA_STR_LEN];
  4081. uint8_t IconQualifier;
  4082. uint8_t IconIdentifier;
  4083. uint8_t ChannelDataLen;
  4084. uint8_t ChannelDataString[CFW_SAT_MAX_CHANNEL_DATA_STR_LEN];
  4085. } CFW_SAT_SENDDATA_RSP_V2;
  4086. typedef struct _CFW_SAT_BROWSER_RSP_V2 ///< for proactive command 0x15
  4087. {
  4088. uint8_t nComID;
  4089. uint8_t nComQualifier;
  4090. uint8_t nBrowserIdentity;
  4091. uint8_t nURLLength;
  4092. uint8_t nBearerLength;
  4093. uint8_t nCodeScheme;
  4094. uint8_t nTextLength; ///< Gateway/Proxy
  4095. uint8_t nAlphaLength;
  4096. uint8_t nIconQualifier;
  4097. uint8_t nIconIdentifier;
  4098. uint8_t nProvisioningFileRefNum;
  4099. uint8_t nPading;
  4100. uint8_t pURL[CFW_SAT_MAX_URL_LEN];
  4101. uint8_t pListBearer[CFW_SAT_MAX_LIST_BEARER_LEN];
  4102. uint8_t nTextString[CFW_SAT_MAX_TEXT_STR_LEN];
  4103. uint8_t nAlphaIdentifier[CFW_SAT_MAX_ALPHA_STR_LEN];
  4104. uint8_t pProvisioningFileRef[CFW_SAT_MAX_PROVISIONING_FILE_LEN];
  4105. } CFW_SAT_BROWSER_RSP_V2;
  4106. typedef struct _CFW_SAT_SEND_DTMF_RSP_V2 ///< for proactive command
  4107. {
  4108. uint8_t nComID;
  4109. uint8_t nComQualifier;
  4110. uint8_t nAlphaLen;
  4111. uint8_t pAlphaStr[CFW_SAT_MAX_ALPHA_STR_LEN];
  4112. uint8_t nDTMFLen;
  4113. uint8_t pDTMFStr[CFW_SAT_MAX_DTMF_STR_LEN];
  4114. } CFW_SAT_SEND_DTMF_RSP_V2;
  4115. typedef struct _CFW_SAT_PDU_RSP_V2 ///< for proactive command 0x15
  4116. {
  4117. uint8_t nComID;
  4118. uint8_t nComNum;
  4119. uint8_t nComQualifier;
  4120. uint8_t nLength;
  4121. uint8_t pPDU[CFW_MAX_SMS_PDU_LEN];
  4122. } CFW_SAT_PDU_RSP_V2;
  4123. typedef struct _CFW_SAT_DTEXT_RSP ///< for proactive command 0x21
  4124. {
  4125. uint8_t nComID;
  4126. uint8_t nComQualifier;
  4127. uint8_t nTextLen;
  4128. uint8_t nTextSch;
  4129. uint8_t *pTextStr;
  4130. } CFW_SAT_DTEXT_RSP;
  4131. typedef struct _CFW_SAT_POLL_INTERVAL_RSP ///< for proactive command 0x21
  4132. {
  4133. uint8_t nComID;
  4134. uint8_t nComQualifier;
  4135. uint8_t nTimeUnit;
  4136. uint8_t nTimeInterval;
  4137. } CFW_SAT_POLL_INTERVAL_RSP;
  4138. typedef struct _CFW_SAT_INPUT_RSP ///< for proactive command 0x23
  4139. {
  4140. uint8_t nComID;
  4141. uint8_t nComQualifier;
  4142. uint8_t nTextLen;
  4143. uint8_t nTextSch;
  4144. uint8_t *pTextStr;
  4145. uint8_t nResMinLen;
  4146. uint8_t nResMaxLen;
  4147. uint8_t nDefTextLen;
  4148. uint8_t nDefTextSch;
  4149. uint8_t *pDefTextStr;
  4150. } CFW_SAT_INPUT_RSP;
  4151. typedef struct _CFW_SAT_INKEY_RSP ///< for proactive command 0x23
  4152. {
  4153. uint8_t nComID;
  4154. uint8_t nComQualifier;
  4155. uint8_t nTextLen;
  4156. uint8_t nTextSch;
  4157. uint8_t *pTextStr;
  4158. } CFW_SAT_INKEY_RSP;
  4159. typedef struct _CFW_SAT_CALL_RSP ///< for proactive command 0x10
  4160. {
  4161. uint8_t nComID;
  4162. uint8_t nComQualifier;
  4163. uint16_t nAlphaConfirmLen;
  4164. uint8_t *pAlphaConfirmStr;
  4165. uint8_t nAddrLen;
  4166. uint8_t nAddrType;
  4167. uint8_t *pAddrStr;
  4168. uint8_t nCapabilityCfgLen;
  4169. uint8_t *pCapabilityCfgStr;
  4170. uint8_t nSubAddrLen;
  4171. uint8_t *pSubAddrStr;
  4172. uint8_t nTuint;
  4173. uint8_t nTinterval;
  4174. uint16_t nAlphaSetupLen;
  4175. uint8_t *pAlphaSetupStr;
  4176. } CFW_SAT_CALL_RSP;
  4177. typedef struct _CFW_SAT_SS_RSP ///< for proactive command 0x10
  4178. {
  4179. uint8_t nComID;
  4180. uint8_t nComQualifier;
  4181. uint8_t nAlphaLength;
  4182. uint8_t *nAlphaIdentifier;
  4183. uint8_t nIconQualifier;
  4184. uint8_t nIconIdentifier;
  4185. uint8_t nSSLength;
  4186. uint8_t nTONNPI;
  4187. uint8_t *pSSStr;
  4188. } CFW_SAT_SS_RSP;
  4189. typedef struct _CFW_SAT_USSD_RSP ///< for proactive command 0x10
  4190. {
  4191. uint8_t nComID;
  4192. uint8_t nComQualifier;
  4193. uint8_t nAlphaLength;
  4194. uint8_t *nAlphaIdentifier;
  4195. uint8_t nIconQualifier;
  4196. uint8_t nIconIdentifier;
  4197. uint8_t nUSSDLength;
  4198. uint8_t nCodeScheme;
  4199. uint8_t *pUSSDStr;
  4200. } CFW_SAT_USSD_RSP;
  4201. #define MAX_NUM_EVENT_LIST 11 ///< 11 type of events
  4202. typedef struct _CFW_SAT_EVENTLIST_RSP ///< for proactive command 0x10
  4203. {
  4204. uint8_t nComID;
  4205. uint8_t nComQualifier;
  4206. uint8_t nNumEvent;
  4207. uint8_t nEventList[MAX_NUM_EVENT_LIST];
  4208. } CFW_SAT_EVENTLIST_RSP;
  4209. typedef struct _CFW_SAT_FILELIST_RSP ///< for proactive command 0x10
  4210. {
  4211. uint8_t nComID;
  4212. uint8_t nComQualifier;
  4213. uint8_t nMode;
  4214. uint8_t nNumFiles;
  4215. uint8_t nFiles[0];
  4216. } CFW_SAT_FILELIST_RSP;
  4217. typedef struct _CFW_SAT_PLAYTONE_RSP
  4218. {
  4219. uint8_t nComID;
  4220. uint8_t nComQualifier;
  4221. uint8_t TimeUnit;
  4222. uint8_t TimeInterval;
  4223. uint8_t Tone;
  4224. uint8_t IconQualifier;
  4225. uint8_t IconIdentifier;
  4226. uint8_t AlphaIDLen;
  4227. union {
  4228. uint8_t *AlphaIDString;
  4229. uint8_t *pAlphaIDString;
  4230. };
  4231. uint8_t *pTextAttribute;
  4232. uint8_t TextAttrLen;
  4233. uint8_t FrameIdent;
  4234. } CFW_SAT_PLAYTONE_RSP;
  4235. #define OPEN_CHANNEL_BEARER_CSD 01
  4236. #define OPEN_CHANNEL_BEARER_GPRS 02
  4237. #define OPEN_CHANNEL_BEARER_DEFAULT 03
  4238. typedef struct _CFW_SAT_OPENCHANNEL_RSP ///< for proactive command 0x15
  4239. {
  4240. uint8_t nComID;
  4241. uint8_t nComQualifier;
  4242. uint8_t AlphaIdentifierLen;
  4243. uint8_t *AlphaIdentifier;
  4244. uint8_t IconQualifier;
  4245. uint8_t IconIdentifier;
  4246. uint8_t AddressType;
  4247. uint8_t AddressLen;
  4248. uint8_t *Address;
  4249. uint8_t SubAddressLen;
  4250. uint8_t *SubAddress;
  4251. uint8_t Duration1Unit;
  4252. uint8_t Duration1Interval;
  4253. uint8_t Duration2Unit;
  4254. uint8_t Duration2Interval;
  4255. uint8_t BearerType;
  4256. uint8_t BearerLen;
  4257. uint8_t *BearerDescription;
  4258. uint16_t BufferSize;
  4259. uint8_t OtherAddressLen;
  4260. uint8_t OtherAddressType;
  4261. uint8_t *OtherAddress;
  4262. uint8_t UserLoginLen;
  4263. uint8_t UserLoginDcs;
  4264. uint8_t *UserLogin;
  4265. uint8_t UserPasswordLen;
  4266. uint8_t UserPasswordDcs;
  4267. uint8_t *UserPassword;
  4268. uint8_t TransportLevelType;
  4269. uint16_t TransportLevelPort;
  4270. uint8_t DestAddressLen;
  4271. uint8_t DestAddressType;
  4272. uint8_t *DestAddress;
  4273. uint8_t NetworkAccessNameLen;
  4274. uint8_t *NetworkAccessName;
  4275. } CFW_SAT_OPENCHANNEL_RSP;
  4276. typedef struct _CFW_SAT_CLOSECHANNEL_RSP ///< for proactive command 0x15
  4277. {
  4278. uint8_t nComID;
  4279. uint8_t nComQualifier;
  4280. uint8_t nChannelID;
  4281. uint8_t AlphaIdentifierLen;
  4282. uint8_t *AlphaIdentifier;
  4283. uint8_t IconQualifier;
  4284. uint8_t IconIdentifier;
  4285. } CFW_SAT_CLOSECHANNEL_RSP;
  4286. typedef struct _CFW_SAT_RECEIVEDATA_RSP ///< for proactive command 0x15
  4287. {
  4288. uint8_t nComID;
  4289. uint8_t nComQualifier;
  4290. uint8_t AlphaIdentifierLen;
  4291. uint8_t *AlphaIdentifier;
  4292. uint8_t IconQualifier;
  4293. uint8_t IconIdentifier;
  4294. uint8_t ChannelID;
  4295. uint8_t ChannelDataLength;
  4296. } CFW_SAT_RECEIVEDATA_RSP;
  4297. typedef struct _CFW_SAT_SENDDATA_RSP ///< for proactive command 0x15
  4298. {
  4299. uint8_t nComID;
  4300. uint8_t nComQualifier;
  4301. uint8_t AlphaIdentifierLen;
  4302. uint8_t *AlphaIdentifier;
  4303. uint8_t IconQualifier;
  4304. uint8_t IconIdentifier;
  4305. uint8_t ChannelID;
  4306. uint8_t ChannelDataLen;
  4307. uint8_t *ChannelDataString;
  4308. } CFW_SAT_SENDDATA_RSP;
  4309. typedef struct _CFW_SAT_GETCHANNELSTATUS_RSP ///< for proactive command 0x15
  4310. {
  4311. uint8_t nComID;
  4312. uint8_t nComQualifier;
  4313. } CFW_SAT_GETCHANNELSTATUS_RSP;
  4314. typedef struct _CFW_SAT_BROWSER_RSP ///< for proactive command 0x15
  4315. {
  4316. uint8_t nComID;
  4317. uint8_t nComQualifier;
  4318. uint8_t nBrowserIdentity;
  4319. uint8_t nURLLength;
  4320. uint8_t nBearerLength;
  4321. uint8_t nCodeScheme;
  4322. uint8_t nTextLength; ///< Gateway/Proxy
  4323. uint8_t nAlphaLength;
  4324. uint8_t nIconQualifier;
  4325. uint8_t nIconIdentifier;
  4326. uint8_t nProvisioningFileRefNum;
  4327. uint8_t nPading;
  4328. uint8_t *pURL;
  4329. uint8_t *pListBearer;
  4330. uint8_t *nTextString;
  4331. uint8_t *nAlphaIdentifier;
  4332. uint8_t *pProvisioningFileRef[1];
  4333. } CFW_SAT_BROWSER_RSP;
  4334. typedef struct _CFW_SAT_TIMER_RSP ///< for proactive command 0x15
  4335. {
  4336. uint8_t nComID;
  4337. uint8_t nComQualifier;
  4338. uint8_t nTimerID;
  4339. uint8_t nHour;
  4340. uint8_t nMinute;
  4341. uint8_t nSecond;
  4342. } CFW_SAT_TIMER_RSP;
  4343. typedef struct _CFW_SAT_SEND_DTMF_RSP ///< for proactive command
  4344. {
  4345. uint8_t nComID;
  4346. uint8_t nComQualifier;
  4347. uint8_t nAlphaLen;
  4348. uint8_t *pAlphaStr;
  4349. uint8_t nDTMFLen;
  4350. uint8_t *pDTMFStr;
  4351. } CFW_SAT_SEND_DTMF_RSP;
  4352. typedef struct _CFW_SAT_LANG_NOTIFICATION_RSP
  4353. {
  4354. uint8_t nComID;
  4355. uint8_t nComQualifier;
  4356. uint8_t nLanguage[2];
  4357. } CFW_SAT_LANG_NOTIFICATION_RSP;
  4358. typedef struct _CFW_SAT_BASE_RSP
  4359. {
  4360. uint8_t nComID;
  4361. uint8_t nComQualifier;
  4362. } CFW_SAT_BASE_RSP;
  4363. typedef struct _CFW_SAT_PDU_RSP ///< for proactive command 0x15
  4364. {
  4365. uint8_t nComID;
  4366. uint8_t nComNum;
  4367. uint8_t nComQualifier;
  4368. uint8_t nLength;
  4369. uint8_t *pPDU;
  4370. } CFW_SAT_PDU_RSP;
  4371. typedef union {
  4372. CFW_SAT_BASE_RSP uBase;
  4373. CFW_SAT_SEND_DTMF_RSP uSendDtmp;
  4374. CFW_SAT_TIMER_RSP uTimer;
  4375. CFW_SAT_GETCHANNELSTATUS_RSP uGetChannelStatus;
  4376. CFW_SAT_EVENTLIST_RSP uEventList;
  4377. CFW_SAT_POLL_INTERVAL_RSP uInterval;
  4378. CFW_SAT_PDU_RSP_V2 uPDUV2;
  4379. CFW_SAT_SEND_DTMF_RSP_V2 uSendDtmfV2;
  4380. CFW_SAT_BROWSER_RSP_V2 uBrowserV2;
  4381. CFW_SAT_SENDDATA_RSP_V2 uSendDataV2;
  4382. CFW_SAT_RECEIVEDATA_RSP_V2 uReceDataV2;
  4383. CFW_SAT_CLOSECHANNEL_RSP_V2 uCloseChannelV2;
  4384. CFW_SAT_OPENCHANNEL_RSP_V2 uOpenChannelV2;
  4385. CFW_SAT_PLAYTONE_RSP_V2 uPlayToneV2;
  4386. CFW_SAT_FILELIST_RSP_V2 uFileListV2;
  4387. CFW_SAT_USSD_RSP_V2 uUssdV2;
  4388. CFW_SAT_SS_RSP_V2 uSSV2;
  4389. CFW_SAT_CALL_RSP_V2 uCallV2;
  4390. CFW_SAT_INKEY_RSP_V2 uInkeyV2;
  4391. CFW_SAT_INPUT_RSP_V2 uInputV2;
  4392. CFW_SAT_DTEXT_RSP_V2 uDtextV2;
  4393. CFW_SAT_SMS_RSP_V2 uSMSV2;
  4394. } CFW_SAT_RSP_UNION;
  4395. //These Macro will be add to system header files.
  4396. //This Macro definition is used for ParsSW1SW2 function.
  4397. #define ERR_CME_SIM_VERIFY_FAIL 0x20
  4398. #define ERR_CME_SIM_UNBLOCK_FAIL 0x21
  4399. #define ERR_CME_SIM_CONDITION_NO_FULLFILLED 0x22
  4400. #define ERR_CME_SIM_UNBLOCK_FAIL_NO_LEFT 0x23
  4401. #define ERR_CME_SIM_VERIFY_FAIL_NO_LEFT 0x24
  4402. #define ERR_CME_SIM_INVALID_PARAMETER 0x25
  4403. #define ERR_CME_SIM_UNKNOW_COMMAND 0x26
  4404. #define ERR_CME_SIM_WRONG_CLASS 0x27
  4405. #define ERR_CME_SIM_TECHNICAL_PROBLEM 0x28
  4406. #define ERR_CME_SIM_CHV_NEED_UNBLOCK 0x29
  4407. #define ERR_CME_SIM_NOEF_SELECTED 0x2A
  4408. #define ERR_CME_SIM_FILE_UNMATCH_COMMAND 0x2B
  4409. #define ERR_CME_SIM_CONTRADICTION_CHV 0x2C
  4410. #define ERR_CME_SIM_CONTRADICTION_INVALIDATION 0x2D
  4411. #define ERR_CME_SIM_MAXVALUE_REACHED 0x2E
  4412. #define ERR_CME_SIM_PATTERN_NOT_FOUND 0x2F
  4413. #define ERR_CME_SIM_FILEID_NOT_FOUND 0x30
  4414. #define ERR_CME_SIM_STK_BUSY 0x31
  4415. #define ERR_CME_SIM_UNKNOW 0x32
  4416. #define ERR_CME_SIM_PROFILE_ERROR 0x33
  4417. // WARNING
  4418. #define ERR_CME_SIM_NO_INFORMATION 0x34
  4419. #define ERR_CME_SIM_RETURN_DATA_CORRUPTED 0x35
  4420. #define ERR_CME_SIM_LESS_DATA 0x36
  4421. #define ERR_CME_SIM_SELECT_FILE_INVALIDATED 0x37
  4422. #define ERR_CME_SIM_SELECT_FILE_TERMINATION 0x38
  4423. #define ERR_CME_SIM_MORE_DATA 0x39
  4424. #define ERR_CME_SIM_MORE_DATA_PROACTIVE_COMMAND_PENDING 0x3A
  4425. #define ERR_CME_SIM_RESPONSE_DATA_AVAILABLE 0x3B
  4426. #define ERR_CME_SIM_MORE_DATA_EXPECTED 0x3C
  4427. #define ERR_CME_SIM_MORE_DATA_EXPECTED_PROACTIVE_COMMAND_PENDING 0x3D
  4428. #define ERR_CME_SIM_COMMAND_SUCCESS_VERIFICATION_FAIL 0x3E
  4429. //Execution errors
  4430. #define ERR_CME_SIM_MEMORY_PROBLEM 0x3F
  4431. // Functions in CLA not supported
  4432. #define ERR_CME_SIM_LOGIC_CHANNEL_NO_SUPPORTED 0x40
  4433. #define ERR_CME_SIM_SECURE_MESSAGING_NO_SUPPORTED 0x41
  4434. //Command not allowed
  4435. #define ERR_CME_SIM_COMMAND_IMCOMPATIBLE 0x42
  4436. #define ERR_CME_SIM_SECURITY_STATUS_NO_SATISFIED 0x43
  4437. #define ERR_CME_SIM_AUTH_PIN_METHOD_BLOCKED 0x44
  4438. #define ERR_CME_SIM_REFERENCED_DATA_INVALIDATED 0x45
  4439. #define ERR_CME_SIM_USE_CONDITIONS_NOT_SATISFIED 0x46
  4440. #define ERR_CME_SIM_COMMAND_NOT_ALLOWED 0x47
  4441. #define ERR_CME_SIM_COMMAND_NOT_ALLOWED_SECURITY_NOT_SATISFIED 0x48
  4442. //Wrong parameters
  4443. #define ERR_CME_SIM_INCORRECT_PARA_IN_DATA_FIELD 0x49
  4444. #define ERR_CME_SIM_FUNCTION_NOT_SUPPORTED 0x4a
  4445. #define ERR_CME_SIM_FILE_NOT_FOUND 0x4B
  4446. #define ERR_CME_SIM_RECORD_NOT_FOUND 0x4C
  4447. #define ERR_CME_SIM_NOT_ENOUGH_MEMORY 0x4D
  4448. #define ERR_CME_SIM_INCORRECT_PARA_P1_P2 0x4E
  4449. #define ERR_CME_SIM_LC_INCONSISTENT_WITH_P1_P2 0x4F
  4450. #define ERR_CME_SIM_REFERENCED_DATA_NOT_FOUND 0x50
  4451. //Application errors
  4452. #define ERR_CME_SIM_AUTH_ERROR_APPLICATION_SPECIFIC 0x51
  4453. #define ERR_CME_SIM_SECURITY_SESSION_ASSOCIATION_EXPIRED 0x52
  4454. //#define EV_CFW_SIM_LISTCOUNT_PBK_ENTRY_RSP 16 ///< for List counter function event id
  4455. #define ERR_SCL_QUEUE_FULL 0x23 ///<
  4456. #define ERR_CFW_INVALID_COMMAND 1
  4457. //end
  4458. #define SIM_PBK_NAME_SIZE 50 ///< Lixp updated,20071225
  4459. #define SIM_PBK_NUMBER_SIZE 10
  4460. #define SIM_PBK_EXTR_SIZE (SIM_PBK_NUMBER_SIZE + SIM_PBK_NAME_SIZE)
  4461. typedef struct _CFW_SIM_PBK_ENTRY_INFO
  4462. {
  4463. uint8_t *pNumber;
  4464. uint8_t *pFullName;
  4465. uint8_t iFullNameSize;
  4466. uint8_t nNumberSize;
  4467. uint8_t nType;
  4468. uint16_t phoneIndex;
  4469. uint8_t *pRecordData;
  4470. } CFW_SIM_PBK_ENTRY_INFO;
  4471. typedef struct _CFW_SIM_PBK_ENTRY_INFO_V2
  4472. {
  4473. uint8_t pNumber[SIM_PBK_NUMBER_SIZE];
  4474. uint8_t pFullName[SIM_PBK_NAME_SIZE];
  4475. uint8_t iFullNameSize;
  4476. uint8_t nNumberSize;
  4477. uint8_t nType;
  4478. uint16_t phoneIndex;
  4479. uint8_t *pRecordData;
  4480. } CFW_SIM_PBK_ENTRY_INFO_V2;
  4481. typedef struct _CFW_SIM_PUCT_INFO
  4482. {
  4483. uint8_t iCurrency[3]; ///< currency code
  4484. uint16_t iEPPU;
  4485. uint8_t iEX;
  4486. bool iSign; ///< the sign of EX,1 is the negetive sign
  4487. uint8_t padding;
  4488. } CFW_SIM_PUCT_INFO;
  4489. #define CFW_SIM_PBKMODE_ADN 0
  4490. #define CFW_SIM_PBKMODE_FDN 1
  4491. uint32_t CFW_SimGetPbkMode(
  4492. uint16_t nUTI);
  4493. uint32_t CFW_SimSetPbkMode(
  4494. uint8_t nPbkMode,
  4495. uint16_t nUTI);
  4496. typedef struct _CFW_PBK_STORAGE
  4497. {
  4498. uint16_t usedSlot;
  4499. uint16_t totalSlot;
  4500. uint16_t storageId;
  4501. uint8_t padding[2];
  4502. } CFW_PBK_STORAGE;
  4503. //add by wulc begin
  4504. typedef struct _CFW_SPN
  4505. {
  4506. uint8_t flag;
  4507. uint8_t spn[16];
  4508. } CFW_SPN;
  4509. //add by wulc end
  4510. #define CFW_STY_FAC_TYPE_SC 0x5343 ///< SIM (lock SIM cards). SIM requests password upon ME power up and when this lock command is issued. "SC" lock is protected with SIM PIN1. The number can be modified with this function.
  4511. #define CFW_STY_FAC_TYPE_PS 0x5053 ///< Phone locked to SIM (device code). The "PS" password may either be individually specified by the client or, depending on the subscription, supplied from the provider (e.g. with a prepaid mobile).
  4512. #define CFW_STY_FAC_TYPE_P2 0x5032 ///< SIM PIN2.
  4513. #define CFW_STY_FAC_TYPE_PF 0x5046 ///< lock Phone to the very first SIM card
  4514. #define CFW_STY_FAC_TYPE_PN 0x504E ///< Network Personalisation
  4515. #define CFW_STY_FAC_TYPE_PU 0x5055 ///< Network-subset Personalisation
  4516. #define CFW_STY_FAC_TYPE_PP 0x5050 ///< Service-Provider Personalisation
  4517. #define CFW_STY_FAC_TYPE_PC 0x5043 ///< Corporate Personalisation
  4518. #define CFW_STY_FAC_TYPE_FD 0x4644 ///< the phone numbers stored to the "FD" memory can be dialled (depending on the SIM card, usually up to 7 numbers). If PIN2 authentication has not been performed during the current session, PIN2 is requested as <passwd>.
  4519. #define CFW_STY_AUTH_READY 0 ///< Phone is not waiting for any password.
  4520. #define CFW_STY_AUTH_PIN1_READY 1 ///< Phone is not waiting for PIN1 password.
  4521. #define CFW_STY_AUTH_SIMPIN 2 ///< Phone is waiting for the SIM Personal Identification Number (PIN)
  4522. #define CFW_STY_AUTH_SIMPUK 3 ///< Phone is waiting for the SIM Personal Unlocking Key (PUK).
  4523. #define CFW_STY_AUTH_PHONE_TO_SIMPIN 4 ///< Phone is waiting for the phone-to-SIM card password.
  4524. #define CFW_STY_AUTH_PHONE_TO_FIRST_SIMPIN 5 ///< Phone is waiting for the phone-to-first-SIM card PIN.
  4525. #define CFW_STY_AUTH_PHONE_TO_FIRST_SIMPUK 6 ///< Phone is waiting for the phone-to-first-SIM card PUK.
  4526. #define CFW_STY_AUTH_SIMPIN2 7 ///< Phone is waiting for the SIM PIN2.
  4527. #define CFW_STY_AUTH_SIMPUK2 8 ///< Phone is waiting for the SIM PUK2.
  4528. #define CFW_STY_AUTH_NETWORKPIN 9 ///< Phone is waiting for the network personalization PIN.
  4529. #define CFW_STY_AUTH_NETWORKPUK 10 ///< Phone is waiting for the network personalization PUK.
  4530. #define CFW_STY_AUTH_NETWORK_SUBSETPIN 11 ///< Phone is waiting for the network subset personalization PIN.
  4531. #define CFW_STY_AUTHNETWORK_SUBSETPUK 12 ///< Phone is waiting for the network subset personalization PUK.
  4532. #define CFW_STY_AUTH_PROVIDERPIN 13 ///< Phone is waiting for the service provider personalization PIN.
  4533. #define CFW_STY_AUTH_PROVIDERPUK 14 ///< Phone is waiting for the service provider personalization PUK.
  4534. #define CFW_STY_AUTH_CORPORATEPIN 15 ///< Phone is waiting for the corporate personalization PIN.
  4535. #define CFW_STY_AUTH_CORPORATEPUK 16 ///< Phone is waiting for the corporate personalization PUK.
  4536. #define CFW_STY_AUTH_NOSIM 17 ///< No SIM inserted.
  4537. //
  4538. //add by lixp
  4539. //
  4540. #define CFW_STY_AUTH_PIN1BLOCK 18
  4541. #define CFW_STY_AUTH_PIN2BLOCK 19
  4542. #define CFW_STY_AUTH_PIN1_DISABLE 20
  4543. #define CFW_STY_AUTH_SIM_PRESENT 21
  4544. #define CFW_STY_AUTH_SIM_PHASE 22
  4545. #define CFW_STY_AUTH_SIM_END 23
  4546. #define CFW_STY_AUTH_PIN2_DISABLE 24
  4547. #define CFW_STY_AUTH_GENERALPIN 25
  4548. #define CFW_STY_AUTH_TOTALPIN 26
  4549. typedef struct _CFW_PROFILE
  4550. {
  4551. //b0 == FDN
  4552. //b1 == BDN
  4553. //b2 == CC
  4554. //0: Not Support,1: Support
  4555. uint16_t nStart_Profile;
  4556. uint8_t nSat_ProfileLen;
  4557. uint8_t pSat_ProfileData[34]; ///< 3gpp 11.14
  4558. } CFW_PROFILE;
  4559. typedef struct _CFW_UsimEfStatus
  4560. {
  4561. uint8_t efStructure; // 1:Transparent ; 2: Linear Fixed ; 6: Cyclic
  4562. uint16_t fileId;
  4563. uint16_t fileSize;
  4564. uint8_t recordLength;
  4565. uint8_t numberOfRecords;
  4566. } CFW_UsimEfStatus;
  4567. typedef struct CFW_SIM_GET_STATUS
  4568. {
  4569. uint8_t nFileID;
  4570. uint8_t nStatus;
  4571. } CFW_SIM_GET_STATUS;
  4572. uint32_t CFW_SimGetDFStatus(uint8_t nFile, uint16_t nUTI, CFW_SIM_ID nSimID);
  4573. void CFW_UsimDecodeEFFcp(
  4574. uint8_t *RespData,
  4575. CFW_UsimEfStatus *pSimEfStatus);
  4576. uint32_t CFW_UsimDecodeEFFcpV2(
  4577. uint8_t *RespData,
  4578. uint16_t iLen,
  4579. CFW_UsimEfStatus *pSimEfStatus);
  4580. uint32_t CFW_SimChangePassword(
  4581. uint16_t nFac,
  4582. uint8_t *pBufOldPwd,
  4583. uint8_t nOldPwdSize,
  4584. uint8_t *pBufNewPwd,
  4585. uint8_t nNewPwdSize,
  4586. uint16_t nUTI,
  4587. CFW_SIM_ID nSimID);
  4588. /*! \brief function retrieves the status of phone authentication.
  4589. The result should be returned through the EV_CFW_STY_GET_AUTH_STATUS_RSP event:
  4590. \rst
  4591. +------+-------+-----------------------------+-------------------------------------------------------------------------------------------------+-------------+
  4592. | UTI | nType | nParam1 | nParam2 | Description |
  4593. +======+=======+=============================+=================================================================================================+=============+
  4594. | nUTI | 0x00 | Specify the authentication | Retrieves the number of attempts still available for entering a required password(PIN, PUK etc) | OK |
  4595. | | | status needed, which is one | \ (LOUINT16(nParam2)&0x0F) = PIN1 Count. | |
  4596. | | | of the constants which | \ ((LOUINT16(nParam2)&0xF0)>>4) = PUK1Count. | |
  4597. | | | described in Remarks | \ ((LOUINT16(nParam2)&0xF00)>>8) = PIN2 Count. | |
  4598. | | | session below. | \ ((LOUINT16(nParam2)&0xF000)>>12) = PUK2 Count. | |
  4599. +------+-------+-----------------------------+-------------------------------------------------------------------------------------------------+-------------+
  4600. | nUTI | 0xF0 | Error code | 0 | Error |
  4601. +------+-------+-----------------------------+-------------------------------------------------------------------------------------------------+-------------+
  4602. \endrst
  4603. when the type of notification event is 0xF0, the param1 can be one of the following value:
  4604. - \a CFW_STY_AUTH_READY Phone is not waiting for PIN1 and PIN2 password.
  4605. - \a CFW_STY_AUTH_PIN1_READY Phone is not waiting for PIN1 password.
  4606. - \a CFW_STY_AUTH_SIMPIN Phone is waiting for the SIM Personal Identification Number (PIN1)
  4607. - \a CFW_STY_AUTH_SIMPUK Phone is waiting for the SIM Personal Unlocking Key (PUK1).
  4608. - \a CFW_STY_AUTH_SIMPIN2 Phone is waiting for the SIM PIN2.
  4609. - \a CFW_STY_AUTH_SIMPUK2 Phone is waiting for the SIM PUK2.
  4610. - \a CFW_STY_AUTH_NOSIM No SIM inserted.
  4611. \param [in] nUTI UTI operation
  4612. \param [in] nSimID SIM ID
  4613. \return \a ERR_SUCCESS on success, or error code
  4614. - \a ERR_CME_OPERATION_NOT_ALLOWED This function don't complete, and you execute the same operations such as call this function again. or SIM is initializing.
  4615. - \a ERR_NO_MORE_MEMORY No any more memory to allocate.
  4616. - \a ERR_CFW_NOT_EXIST_FREE_UTI No any available free UTI in the system.
  4617. - \a ERR_CFW_UTI_IS_BUSY The UTI is busy, maybe the UTI is used by other instance.
  4618. - \a ERR_CME_UNKNOWN Unknown error occur.
  4619. */
  4620. uint32_t CFW_SimGetAuthenticationStatus(
  4621. uint16_t nUTI,
  4622. CFW_SIM_ID nSimID);
  4623. /*! \brief function enter PIN authentication.
  4624. The result should be returned through the EV_CFW_SIM_ENTER_AUTH_RSP event:
  4625. \rst
  4626. +------+-------+------------+---------+------------------------------------------------+
  4627. | UTI | nType | nParam1 | nParam2 | Description |
  4628. +======+=======+============+=========+================================================+
  4629. | nUTI | 0x00 | 0 | 0 | Entry auth OK |
  4630. +------+-------+------------+---------+------------------------------------------------+
  4631. | nUTI | 0x00 | 1 | 0 | Phone is not waiting for PIN1 or PIN2 password |
  4632. +------+-------+------------+---------+------------------------------------------------+
  4633. | nUTI | 0x00 | 18 | 0 | PIN1 BLOCK |
  4634. +------+-------+------------+---------+------------------------------------------------+
  4635. | nUTI | 0x00 | 19 | 0 | PIN2 BLOCK |
  4636. +------+-------+------------+---------+------------------------------------------------+
  4637. | nUTI | 0xF0 | error code | 0 | Error |
  4638. +------+-------+------------+---------+------------------------------------------------+
  4639. \endrst
  4640. \param [in] pPin Pointer to a string containing the current password in ASCII string format. This parameter is shown below in detail:
  4641. \rst
  4642. +---------+------------------------------------------------------+------------------------------------------------+
  4643. | nOption | pPin | pNewPin |
  4644. +=========+======================================================+================================================+
  4645. | 0 | process by CFW, decide to select PIN1 or PIN2. | process by CFW, decide to select PIN1 or PIN2. |
  4646. +---------+------------------------------------------------------+------------------------------------------------+
  4647. | 1 | SIM PIN1 | NULL(ignored) |
  4648. +---------+------------------------------------------------------+------------------------------------------------+
  4649. | 1 | PUK,such as SIM PUK or PHSIM PUK or PH-FSIM PUK | new pin password |
  4650. +---------+------------------------------------------------------+------------------------------------------------+
  4651. | 2 | SIM PIN2 | NULL(ignored) |
  4652. +---------+------------------------------------------------------+------------------------------------------------+
  4653. | 2 | PUK2, such as SIM PUK2 or PHSIM PUK2 or PH-FSIM PUK2 | new pin password |
  4654. +---------+------------------------------------------------------+------------------------------------------------+
  4655. \endrst
  4656. \param [in] nPinSize The size of pPin in bytes, normally this size is 4 Byte for PIN, and 8 Byte for PUK.
  4657. \param [in] pNewPin If the requested code was a PUK, specify a new password or restore the former disabled password, else this parameter is ignored, you can specify pNewPin=NULL.
  4658. \param [in] nNewPinSize The size of nNewPinSize in bytes, normally this size is 4 Byte for PIN, and 8 Byte for PUK. If pNewPin is NULL, this parameter is ignored.
  4659. \param [in] nOption The option to enter pin, see above.
  4660. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) to support multi-application in parallel. This parameter will be returned in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical module.
  4661. \return \a ERR_SUCCESS on success, or error code
  4662. - \a ERR_CFW_INVALID_PARAMETER The input parameter(nOption) is invalid.
  4663. - \a ERR_CME_OPERATION_NOT_ALLOWED This function don't complete, and you execute other operations such as call CFW_SimEnterAuthentication.
  4664. - \a ERR_NO_MORE_MEMORY No any more memory to allocate for SIM management.
  4665. - \a ERR_CFW_NOT_EXIST_FREE_UTI No any available free UTI in the system.
  4666. - \a ERR_CFW_UTI_IS_BUSY The UTI is busy, maybe the UTI is used by other instance.
  4667. - \a ERR_CME_UNKNOWN Unknown error occur.
  4668. */
  4669. uint32_t CFW_SimEnterAuthentication(
  4670. uint8_t *pPin,
  4671. uint8_t nPinSize,
  4672. uint8_t *pNewPin,
  4673. uint8_t nNewPinSize,
  4674. uint8_t nOption,
  4675. uint16_t nUTI,
  4676. CFW_SIM_ID nSimID);
  4677. /*! \brief function locks and unlocks a SIM related facility.
  4678. \param [in] nFac Specify the facility to check its status. The facility type can be one of the following value:
  4679. - \a CFW_STY_FAC_TYPE_SC SIM (lock SIM cards). SIM requests password upon ME power up and when this lock command is issued. "SC" lock is protected with SIM PIN1.
  4680. The number can be modified with CFW_SimChangePassword function.
  4681. - \a CFW_STY_FAC_TYPE_FD the phone numbers stored to the "FD" memory can be dialled (depending on the SIM card, usually up to 7 numbers). If PIN2 authentication has not been performed during the current session, PIN2 is requested as <passwd>.
  4682. \param [in] pBufPwd Point to the buffer containing the password in ASCII string format If you don't care password, set this pBufPwd to NULL.
  4683. \param [in] nPwdSize The size of pBufPwdin bytes. If pBufPwd is NULL, this parameter is ignored by this function.
  4684. \param [in] nMode 0 to unlock, 1 to lock.
  4685. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) to support multi-application in parallel. This parameter will be returned in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical module.
  4686. \param [in] nSimID SIM ID
  4687. \return \a ERR_SUCCESS on success, or error code
  4688. */
  4689. uint32_t CFW_SimSetFacilityLock(
  4690. uint16_t nFac,
  4691. uint8_t *pBufPwd,
  4692. uint8_t nPwdSize,
  4693. uint8_t nMode,
  4694. uint16_t nUTI,
  4695. CFW_SIM_ID nSimID);
  4696. /*! \brief function gets the status of a facility.
  4697. The result should be returned through the EV_CFW_SIM_GET_FACILITY_LOCK_RSP event:
  4698. \rst
  4699. +------+-------+-----------------------------+-------------------------------------------------------------------------------------------------+-------------+
  4700. | UTI | nType | nParam1 | nParam2 | Description |
  4701. +======+=======+=============================+=================================================================================================+=============+
  4702. | nUTI | 0x00 | LOUINT8=contain the status: | Retrieves the number of attempts still available for entering a required password(PIN, PUK etc) | OK |
  4703. | | | \ 0:not active; | \ (LOUINT16(nParam2)&0x0F) = PIN1 Count. | |
  4704. | | | \ 1:active. | \ ((LOUINT16(nParam2)&0xF0)>>4) = PUK1Count. | |
  4705. | | | | \ ((LOUINT16(nParam2)&0xF00)>>8) = PIN2 Count. | |
  4706. | | | | \ ((LOUINT16(nParam2)&0xF000)>>12) = PUK2 Count. | |
  4707. +------+-------+-----------------------------+-------------------------------------------------------------------------------------------------+-------------+
  4708. | nUTI | 0xF0 | Error code | 0 | Error |
  4709. +------+-------+-----------------------------+-------------------------------------------------------------------------------------------------+-------------+
  4710. \endrst
  4711. \param [in] nFac Specify the facility to check its status. The facility type can be one of the following value:
  4712. - \a CFW_STY_FAC_TYPE_SC SIM (lock SIM cards). SIM requests password upon ME power up and when this lock command is issued. "SC" lock is protected with SIM PIN1.
  4713. The number can be modified with CFW_SimChangePassword function.
  4714. - \a CFW_STY_FAC_TYPE_FD the phone numbers stored to the "FD" memory can be dialled (depending on the SIM card, usually up to 7 numbers). If PIN2 authentication has not been performed during the current session, PIN2 is requested as <passwd>.
  4715. \param [in] nUTI UTI operation
  4716. \param [in] nSimID SIM ID
  4717. \return \a ERR_SUCCESS on success, or error code
  4718. */
  4719. uint32_t CFW_SimGetFacilityLock(
  4720. uint16_t nFac,
  4721. uint16_t nUTI,
  4722. CFW_SIM_ID nSimID);
  4723. /*! \brief function retrieves the International Mobile Subscriber Identity(IMSI).
  4724. The result should be returned through the EV_CFW_SIM_GET_PROVIDER_ID_RSP event:
  4725. \rst
  4726. +-----+-------+-----------------------------------------------------------------------+---------------+-------------+
  4727. | UTI | nType | nParam1 | nParam2 | Description |
  4728. +=====+=======+=======================================================================+===============+=============+
  4729. | NA | 0x00 | Pointer to the buffer to hold the IMSI number in ASCII string format. | buffer length | OK |
  4730. +-----+-------+-----------------------------------------------------------------------+---------------+-------------+
  4731. | NA | 0xF0 | Error code | 0 | Error |
  4732. +-----+-------+-----------------------------------------------------------------------+---------------+-------------+
  4733. \endrst
  4734. \param [in] nUTI UTI operation
  4735. \param [in] nSimID SIM ID
  4736. \return \a ERR_SUCCESS on success, or error code
  4737. */
  4738. uint32_t CFW_SimGetProviderId(
  4739. uint16_t nUTI,
  4740. CFW_SIM_ID nSimID);
  4741. /*! \brief function stores the PLMNs in SIM, this API can be used to delete the PLMNs in SIM.
  4742. The result should be returned through the EV_CFW_SIM_SET_PREF_OPERATOR_LIST_RSPevent:
  4743. \rst
  4744. +------+-------+------------+---------+-------------+
  4745. | UTI | nType | nParam1 | nParam2 | Description |
  4746. +======+=======+============+=========+=============+
  4747. | nUTI | 0x00 | 0 | 0 | OK |
  4748. +------+-------+------------+---------+-------------+
  4749. | nUTI | 0xF0 | Error code | 0 | Error |
  4750. +------+-------+------------+---------+-------------+
  4751. \endrst
  4752. \param [in] nUTI UTI operation
  4753. \param [in] nSimID SIM ID
  4754. \return \a ERR_SUCCESS on success, or error code
  4755. - \a ERR_CFW_INVALID_PARAMETER The input parameter is invalid.
  4756. - \a ERR_CFW_NOT_EXIST_FREE_UTI Not any available free UTI in the system.
  4757. - \a ERR_CFW_UTI_IS_BUSY The UTI is busy, maybe the UTI is used by other instance.
  4758. - \a ERR_CME_MEMORY_FULL Not any more memory to use.
  4759. - \a ERR_CME_UNKNOWN Unknown error occurred.
  4760. */
  4761. uint32_t CFW_SimSetPrefOperatorList(
  4762. uint8_t *pOperatorList,
  4763. uint8_t nSize,
  4764. uint16_t nUTI,
  4765. CFW_SIM_ID nSimID);
  4766. /*! \brief function gets the status of a facility.
  4767. The result should be returned through the EV_CFW_SIM_GET_PREF_OPT_LIST_MAXNUM_RSP event:
  4768. \rst
  4769. +------+-------+-----------------------------------------------------------------------------+---------+-------------+
  4770. | UTI | nType | nParam1 | nParam2 | Description |
  4771. +======+=======+=============================================================================+=========+=============+
  4772. | nUTI | 0x00 | The maximum number of PLMNs that can be stored in this SIM card, always >=8 | 0 | OK |
  4773. +------+-------+-----------------------------------------------------------------------------+---------+-------------+
  4774. | nUTI | 0xF0 | Error code | 0 | Error |
  4775. +------+-------+-----------------------------------------------------------------------------+---------+-------------+
  4776. \endrst
  4777. \param [in] nUTI UTI operation
  4778. \param [in] nSimID SIM ID
  4779. \return \a ERR_SUCCESS on success, or error code
  4780. - \a ERR_CFW_INVALID_PARAMETER The input parameter(nFac) is invalid.
  4781. - \a ERR_CFW_NOT_EXIST_FREE_UTI No any available free UTI in the system.
  4782. - \a ERR_CFW_UTI_IS_BUSY The UTI is busy, maybe the UTI is used by other instance.
  4783. - \a ERR_CME_MEMORY_FULL No any more memory to use.
  4784. - \a ERR_CME_UNKNOWN Unknown error occur.
  4785. */
  4786. uint32_t CFW_SimGetPrefOperatorListMaxNum(
  4787. uint16_t nUTI,
  4788. CFW_SIM_ID nSimID);
  4789. /*! \brief function gets all PLMNs stored in SIM.
  4790. The result should be returned through the EV_CFW_SIM_GET_PREF_OPERATOR_LIST_RSP event:
  4791. \rst
  4792. +------+-------+---------------------------------------------------------------------+--------------------------+-------------+
  4793. | UTI | nType | nParam1 | nParam2 | Description |
  4794. +======+=======+=====================================================================+==========================+=============+
  4795. | nUTI | 0x00 | Pointer to the buffer contained all PLMNs in the format like below: | The number of all PLMNs. | OK |
  4796. | nUTI | 0x00 | 0x04060000000F04060000010F | i.e. 2*6 | |
  4797. +------+-------+---------------------------------------------------------------------+--------------------------+-------------+
  4798. | nUTI | 0xF0 | Error code | 0 | Error |
  4799. +------+-------+---------------------------------------------------------------------+--------------------------+-------------+
  4800. \endrst
  4801. \param [in] nUTI UTI operation
  4802. \param [in] nSimID SIM ID
  4803. \return \a ERR_SUCCESS on success, or error code
  4804. - \a ERR_CFW_NOT_EXIST_FREE_UTI No any available free UTI in the system.
  4805. - \a ERR_CFW_UTI_IS_BUSY The UTI is busy, maybe the UTI is used by other instance.
  4806. - \a ERR_CME_MEMORY_FULL No any more memory to use.
  4807. - \a ERR_CME_UNKNOWN Unknown error occur.
  4808. */
  4809. uint32_t CFW_SimGetPrefOperatorList(
  4810. uint16_t nUTI,
  4811. CFW_SIM_ID nSimID);
  4812. /*! \brief The CFW_SimAddPbkEntry function retrieves an entry from the current phone book.
  4813. The result should be returned asynchronously through the EV_CFW_SIM_ADD_PBK_RSP event which should below structure:
  4814. \rst
  4815. +------+-------+-------------------------------------------+----------------------------+-------------+
  4816. | UTI | nType | nParam1 | nParam2 | Description |
  4817. +======+=======+===========================================+============================+=============+
  4818. | | | Specify the index referenced by nParam1 | | |
  4819. | | | which indicate the memory location of the | nStorage(The same as input | |
  4820. | nUTI | 0x00 | stored phonebook entry.if nStorage= | parameter) | OK |
  4821. | | | CFW_PBK_SIM_LAST_DIALLING,nParam1=0. | | |
  4822. +------+-------+-------------------------------------------+----------------------------+-------------+
  4823. | | | | LOUINT16=Specify the index | |
  4824. | nUTI | 0xF0 | SIM_Errors_Code | of the entry to add . | Error |
  4825. +------+-------+-------------------------------------------+----------------------------+-------------+
  4826. \endrst
  4827. \param [in] nStorage Specify the current phonebook memory storage. This parameter can be one of the following value:
  4828. \rst
  4829. +---------------------------+------------------------------------+
  4830. | Memory Storage | Description |
  4831. +===========================+====================================+
  4832. | | SIM phonebook(storage depends on |
  4833. | CFW_PBK_SIM | SIM Card). |
  4834. +---------------------------+------------------------------------+
  4835. | | SIM fix dialing phonebook (FD |
  4836. | CFW_PBK_SIM_FIX_DIALLING | Phonebook storage). |
  4837. +---------------------------+------------------------------------+
  4838. | | SIM last-dialing-phonebook (LD |
  4839. | CFW_PBK_SIM_LAST_DIALLING | Phonebook storage). |
  4840. +---------------------------+------------------------------------+
  4841. | CFW_PBK_ON | Own numbers (MSISDNs) list. |
  4842. +---------------------------+------------------------------------+
  4843. | | The phonebook storage is specified |
  4844. | CFW_PBK_AUTO | by CFW_CfgSetPbkStorage function |
  4845. +---------------------------+------------------------------------+
  4846. \endrst
  4847. \param [in] pEntryInfo Pointer to CFW_SIM_PBK_ENTRY_INFO structure to hold the phonebook entry info.
  4848. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  4849. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  4850. module. This parameter should be less than 255 for all upper layer application.
  4851. \param [in] nSimID SIM ID
  4852. \return
  4853. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  4854. \rst
  4855. +----------------------------+-----------------------------------------+
  4856. | Error Code | Description |
  4857. +============================+=========================================+
  4858. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  4859. +----------------------------+-----------------------------------------+
  4860. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  4861. +----------------------------+-----------------------------------------+
  4862. | | The UTI is busy, maybe the UTI is used |
  4863. | ERR_CFW_UTI_IS_BUSY | by other instance. |
  4864. +----------------------------+-----------------------------------------+
  4865. | ERR_CME_MEMORY_FULL | No any more memory to allocate |
  4866. +----------------------------+-----------------------------------------+
  4867. | ERR_CME_UNKNOWN | Unknown error occur. |
  4868. +----------------------------+-----------------------------------------+
  4869. \endrst
  4870. */
  4871. uint32_t CFW_SimAddPbkEntry(
  4872. uint8_t nStorage,
  4873. CFW_SIM_PBK_ENTRY_INFO *pEntryInfo,
  4874. uint16_t nUTI,
  4875. CFW_SIM_ID nSimID);
  4876. /*! \brief The CFW_SimAddPbkEntry_V2 function retrieves an entry from the current phone book.
  4877. The result should be returned asynchronously through the EV_CFW_SIM_ADD_PBK_RSP event which should below structure:
  4878. \rst
  4879. +------+-------+-------------------------------------------+----------------------------+-------------+
  4880. | UTI | nType | nParam1 | nParam2 | Description |
  4881. +======+=======+===========================================+============================+=============+
  4882. | | | Specify the index referenced by nParam1 | | |
  4883. | | | which indicate the memory location of the | nStorage(The same as input | |
  4884. | nUTI | 0x00 | stored phonebook entry.if nStorage= | parameter) | OK |
  4885. | | | CFW_PBK_SIM_LAST_DIALLING,nParam1=0. | | |
  4886. +------+-------+-------------------------------------------+----------------------------+-------------+
  4887. | | | | LOUINT16=Specify the index | |
  4888. | nUTI | 0xF0 | SIM_Errors_Code | of the entry to add . | Error |
  4889. +------+-------+-------------------------------------------+----------------------------+-------------+
  4890. \endrst
  4891. \param [in] nStorage Specify the current phonebook memory storage. This parameter can be one of the following value:
  4892. \rst
  4893. +---------------------------+------------------------------------+
  4894. | Memory Storage | Description |
  4895. +===========================+====================================+
  4896. | | SIM phonebook(storage depends on |
  4897. | CFW_PBK_SIM | SIM Card). |
  4898. +---------------------------+------------------------------------+
  4899. | | SIM fix dialing phonebook (FD |
  4900. | CFW_PBK_SIM_FIX_DIALLING | Phonebook storage). |
  4901. +---------------------------+------------------------------------+
  4902. | | SIM last-dialing-phonebook (LD |
  4903. | CFW_PBK_SIM_LAST_DIALLING | Phonebook storage). |
  4904. +---------------------------+------------------------------------+
  4905. | CFW_PBK_ON | Own numbers (MSISDNs) list. |
  4906. +---------------------------+------------------------------------+
  4907. | | The phonebook storage is specified |
  4908. | CFW_PBK_AUTO | by CFW_CfgSetPbkStorage function |
  4909. +---------------------------+------------------------------------+
  4910. \endrst
  4911. \param [in] pEntryInfo Pointer to CFW_SIM_PBK_ENTRY_INFO_V2 structure to hold the phonebook entry info.
  4912. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  4913. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  4914. module. This parameter should be less than 255 for all upper layer application.
  4915. \param [in] nSimID SIM ID
  4916. \return
  4917. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  4918. \rst
  4919. +----------------------------+-----------------------------------------+
  4920. | Error Code | Description |
  4921. +============================+=========================================+
  4922. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  4923. +----------------------------+-----------------------------------------+
  4924. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  4925. +----------------------------+-----------------------------------------+
  4926. | | The UTI is busy, maybe the UTI is used |
  4927. | ERR_CFW_UTI_IS_BUSY | by other instance. |
  4928. +----------------------------+-----------------------------------------+
  4929. | ERR_CME_MEMORY_FULL | No any more memory to allocate |
  4930. +----------------------------+-----------------------------------------+
  4931. | ERR_CME_UNKNOWN | Unknown error occur. |
  4932. +----------------------------+-----------------------------------------+
  4933. \endrst
  4934. */
  4935. uint32_t CFW_SimAddPbkEntry_V2(
  4936. uint8_t nStorage,
  4937. CFW_SIM_PBK_ENTRY_INFO_V2 *pEntryInfo,
  4938. uint16_t nUTI,
  4939. CFW_SIM_ID nSimID);
  4940. /*! \brief The CFW_SimDeletePbkEntry function deletes an entry from the current phone book by pass the specified index.
  4941. the result should be returned through the EV_CFW_SIM_DELETE_PBK_ENTRY_RSP event:
  4942. \rst
  4943. +------+-------+----------------------------+----------------------------+-------------+
  4944. | UTI | nType | nParam1 | nParam2 | Description |
  4945. +======+=======+============================+============================+=============+
  4946. | | | LOUINT16=Specify the index | | |
  4947. | nUTI | 0x00 | of the entry to delete. | 0 | OK |
  4948. +------+-------+----------------------------+----------------------------+-------------+
  4949. | | | | LOUINT16=Specify the index | |
  4950. | nUTI | 0xF0 | SIM_Errors_Code | of the entry to delete. | Error |
  4951. +------+-------+----------------------------+----------------------------+-------------+
  4952. \endrst
  4953. \param [in] nStorage Specify the current phonebook memory storage. This parameter can be one of the following value:
  4954. \rst
  4955. +---------------------------+------------------------------------+
  4956. | Memory Storage | Description |
  4957. +===========================+====================================+
  4958. | | SIM phonebook(storage depends on |
  4959. | CFW_PBK_SIM | SIM Card). |
  4960. +---------------------------+------------------------------------+
  4961. | | SIM fix dialing phonebook (FD |
  4962. | CFW_PBK_SIM_FIX_DIALLING | Phonebook storage). |
  4963. +---------------------------+------------------------------------+
  4964. | | SIM last-dialing-phonebook (LD |
  4965. | CFW_PBK_SIM_LAST_DIALLING | Phonebook storage). |
  4966. +---------------------------+------------------------------------+
  4967. | CFW_PBK_ON | Own numbers (MSISDNs) list. |
  4968. +---------------------------+------------------------------------+
  4969. | | The phonebook storage is specified |
  4970. | CFW_PBK_AUTO | by CFW_CfgSetPbkStorage function |
  4971. +---------------------------+------------------------------------+
  4972. \endrst
  4973. \param [in] nIndex Specify the location number where reading.
  4974. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  4975. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  4976. module. This parameter should be less than 255 for all upper layer application.
  4977. \param [in] nSimID SIM ID
  4978. \return
  4979. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  4980. \rst
  4981. +----------------------------+-----------------------------------------+
  4982. | Error Code | Description |
  4983. +============================+=========================================+
  4984. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  4985. +----------------------------+-----------------------------------------+
  4986. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  4987. +----------------------------+-----------------------------------------+
  4988. | | The UTI is busy, maybe the UTI is used |
  4989. | ERR_CFW_UTI_IS_BUSY | by other instance. |
  4990. +----------------------------+-----------------------------------------+
  4991. | ERR_CME_MEMORY_FULL | No any more memory to allocate |
  4992. +----------------------------+-----------------------------------------+
  4993. | ERR_CME_UNKNOWN | Unknown error occur. |
  4994. +----------------------------+-----------------------------------------+
  4995. \endrst
  4996. */
  4997. uint32_t CFW_SimDeletePbkEntry(
  4998. uint8_t nStorage,
  4999. uint16_t nIndex,
  5000. uint16_t nUTI,
  5001. CFW_SIM_ID nSimID);
  5002. /*! \brief The CFW_SimGetPbkEntry function retrieves an entry from the current phone book.
  5003. the result should be returned through the EV_CFW_SIM_GET_PBK_ENTRY_RSP event:
  5004. \rst
  5005. +------+-------+-----------------+-------------------------------------+-------------+
  5006. | UTI | nType | nParam1 | nParam2 | Description |
  5007. +======+=======+=================+=====================================+=============+
  5008. | | | | HIUINT16=The size of structure | |
  5009. | nUTI | 0x00 | 0 | LOUINT16=The index of SIM pbk entry | OK |
  5010. +------+-------+-----------------+-------------------------------------+-------------+
  5011. | nUTI | 0xF0 | SIM_Errors_Code | 0 | Error |
  5012. +------+-------+-----------------+-------------------------------------+-------------+
  5013. \endrst
  5014. \param [in] nStorage Specify the current phonebook memory storage. This parameter can be one of the following value:
  5015. \rst
  5016. +---------------------------+------------------------------------+
  5017. | Memory Storage | Description |
  5018. +===========================+====================================+
  5019. | | SIM phonebook(storage depends on |
  5020. | CFW_PBK_SIM | SIM Card). |
  5021. +---------------------------+------------------------------------+
  5022. | | SIM fix dialing phonebook (FD |
  5023. | CFW_PBK_SIM_FIX_DIALLING | Phonebook storage). |
  5024. +---------------------------+------------------------------------+
  5025. | | SIM last-dialing-phonebook (LD |
  5026. | CFW_PBK_SIM_LAST_DIALLING | Phonebook storage). |
  5027. +---------------------------+------------------------------------+
  5028. | CFW_PBK_ON | Own numbers (MSISDNs) list. |
  5029. +---------------------------+------------------------------------+
  5030. | CFW_PBK_EN | Emergency Call storage |
  5031. +---------------------------+------------------------------------+
  5032. | | The phonebook storage is specified |
  5033. | CFW_PBK_AUTO | by CFW_CfgSetPbkStorage function |
  5034. +---------------------------+------------------------------------+
  5035. \endrst
  5036. \param [in] nIndex Specify the location number where reading.
  5037. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  5038. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  5039. module. This parameter should be less than 255 for all upper layer application.
  5040. \param [in] nSimID SIM ID
  5041. \return
  5042. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  5043. \rst
  5044. +----------------------------+-----------------------------------------+
  5045. | Error Code | Description |
  5046. +============================+=========================================+
  5047. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  5048. +----------------------------+-----------------------------------------+
  5049. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  5050. +----------------------------+-----------------------------------------+
  5051. | | The UTI is busy, maybe the UTI is used |
  5052. | ERR_CFW_UTI_IS_BUSY | by other instance. |
  5053. +----------------------------+-----------------------------------------+
  5054. | ERR_CME_MEMORY_FULL | No any more memory to allocate |
  5055. +----------------------------+-----------------------------------------+
  5056. \endrst
  5057. */
  5058. uint32_t CFW_SimGetPbkEntry(
  5059. uint8_t nStorage,
  5060. uint16_t nIndex,
  5061. uint16_t nUTI,
  5062. CFW_SIM_ID nSimID);
  5063. /*! \brief The CFW_SimListPbkEntries function retrieves entries from the current phone book by passed the start and end index.
  5064. The result should be returned through the EV_CFW_SIM_LIST_PBK_ENTRY_RSP event:
  5065. \rst
  5066. +------+-------+------------------------+------------------+-------------+
  5067. | UTI | nType | nParam1 | nParam2 | Description |
  5068. +======+=======+========================+==================+=============+
  5069. | | | Pointer to the | | |
  5070. | nUTI | 0x00 | CFW_SIM_PBK_ENTRY_INFO | counter of this | OK |
  5071. | | | structure array. | structure array. | |
  5072. +------+-------+------------------------+------------------+-------------+
  5073. | nUTI | 0xF0 | SIM_Errors_Code | 0 | Error |
  5074. +------+-------+------------------------+------------------+-------------+
  5075. \endrst
  5076. \param [in] nStorage Specify the current phonebook memory storage. This parameter can be one of the following value:
  5077. \rst
  5078. +---------------------------+------------------------------------+
  5079. | Memory Storage | Description |
  5080. +===========================+====================================+
  5081. | | SIM phonebook(storage depends on |
  5082. | CFW_PBK_SIM | SIM Card). |
  5083. +---------------------------+------------------------------------+
  5084. | | SIM fix dialing phonebook (FD |
  5085. | CFW_PBK_SIM_FIX_DIALLING | Phonebook storage). |
  5086. +---------------------------+------------------------------------+
  5087. | | SIM last-dialing-phonebook (LD |
  5088. | CFW_PBK_SIM_LAST_DIALLING | Phonebook storage). |
  5089. +---------------------------+------------------------------------+
  5090. | CFW_PBK_ON | Own numbers (MSISDNs) list. |
  5091. +---------------------------+------------------------------------+
  5092. | CFW_PBK_EN | Emergency Call storage |
  5093. +---------------------------+------------------------------------+
  5094. | | The phonebook storage is specified |
  5095. | CFW_PBK_AUTO | by CFW_CfgSetPbkStorage function |
  5096. +---------------------------+------------------------------------+
  5097. \endrst
  5098. \param [in] nIndexStart Specify the location number where reading starts.
  5099. \param [in] nIndexEnd Specify the location number where reading ends.
  5100. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  5101. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  5102. module. This parameter should be less than 255 for all upper layer application.
  5103. \param [in] nSimID SIM ID
  5104. \return
  5105. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  5106. \rst
  5107. +----------------------------+-----------------------------------------+
  5108. | Error Code | Description |
  5109. +============================+=========================================+
  5110. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  5111. +----------------------------+-----------------------------------------+
  5112. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  5113. +----------------------------+-----------------------------------------+
  5114. | | The UTI is busy, maybe the UTI is used |
  5115. | ERR_CFW_UTI_IS_BUSY | by other instance. |
  5116. +----------------------------+-----------------------------------------+
  5117. | ERR_CME_UNKNOWN | Unknown error occur. |
  5118. +----------------------------+-----------------------------------------+
  5119. \endrst
  5120. */
  5121. uint32_t CFW_SimListPbkEntries(
  5122. uint8_t nStorage,
  5123. uint16_t nIndexStart,
  5124. uint16_t nIndexEnd,
  5125. uint16_t nUTI,
  5126. CFW_SIM_ID nSimID);
  5127. /*! \brief The CFW_SimListPbkEntries function retrieves entries from the current phone book by passed the startindex.
  5128. The result should be returned through the EV_CFW_SIM_LIST_COUNT_PBK_ENTRY_RSP event:
  5129. \rst
  5130. +------+-------+------------------------+------------------+-------------+
  5131. | UTI | nType | nParam1 | nParam2 | Description |
  5132. +======+=======+========================+==================+=============+
  5133. | | | Pointer to the | | |
  5134. | nUTI | 0x00 | CFW_SIM_PBK_ENTRY_INFO | counter of this | OK |
  5135. | | | structure array. | structure array. | |
  5136. +------+-------+------------------------+------------------+-------------+
  5137. | nUTI | 0xF0 | SIM_Errors_Code | 0 | Error |
  5138. +------+-------+------------------------+------------------+-------------+
  5139. \endrst
  5140. \param [in] nStorage Specify the current phonebook memory storage. This parameter can be one of the following value:
  5141. \rst
  5142. +---------------------------+----------------------------------+
  5143. | Memory Storage | Description |
  5144. +===========================+==================================+
  5145. | | SIM phonebook(storage depends on |
  5146. | CFW_PBK_SIM | SIM Card). |
  5147. +---------------------------+----------------------------------+
  5148. | | SIM fix dialing phonebook (FD |
  5149. | CFW_PBK_SIM_FIX_DIALLING | Phonebook storage). |
  5150. +---------------------------+----------------------------------+
  5151. | | SIM last-dialing-phonebook (LD |
  5152. | CFW_PBK_SIM_LAST_DIALLING | Phonebook storage). |
  5153. +---------------------------+----------------------------------+
  5154. | CFW_PBK_ON | Own numbers (MSISDNs) list. |
  5155. +---------------------------+----------------------------------+
  5156. | CFW_PBK_EN | Emergency Call storage |
  5157. +---------------------------+----------------------------------+
  5158. \endrst
  5159. \param [in] nIndexStart Specify the location number where reading starts.
  5160. \param [in] nCount The number of PbkEntries.
  5161. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  5162. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  5163. module. This parameter should be less than 255 for all upper layer application.
  5164. \param [in] nSimID SIM ID
  5165. \return
  5166. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  5167. \rst
  5168. +----------------------------+-----------------------------------------+
  5169. | Error Code | Description |
  5170. +============================+=========================================+
  5171. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  5172. +----------------------------+-----------------------------------------+
  5173. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  5174. +----------------------------+-----------------------------------------+
  5175. | | The UTI is busy, maybe the UTI is used |
  5176. | ERR_CFW_UTI_IS_BUSY | by other instance. |
  5177. +----------------------------+-----------------------------------------+
  5178. | ERR_CME_UNKNOWN | Unknown error occur. |
  5179. +----------------------------+-----------------------------------------+
  5180. \endrst
  5181. */
  5182. uint32_t CFW_SimListCountPbkEntries(
  5183. uint8_t nStorage,
  5184. uint16_t nIndexStart,
  5185. uint16_t nCount,
  5186. uint16_t nUTI,
  5187. CFW_SIM_ID nSimID);
  5188. /*! \brief The CFW_SimGetPbkStrorageInfo gets the current phone book storage information.
  5189. The result should be returned through the EV_CFW_SIM_GET_PBK_STRORAGE_INFO_RSP event:
  5190. \rst
  5191. +------+-------+-----------------------+------------------------+-------------+
  5192. | UTI | nType | nParam1 | nParam2 | Description |
  5193. +======+=======+=======================+========================+=============+
  5194. | | | Pointer to the | | |
  5195. | nUTI | 0x00 | CFW_PBK_STRORAGE_INFO | size of this structure | OK |
  5196. | | | structure array. | | |
  5197. +------+-------+-----------------------+------------------------+-------------+
  5198. | nUTI | 0xF0 | SIM_Errors_Code | 0 | Error |
  5199. +------+-------+-----------------------+------------------------+-------------+
  5200. \endrst
  5201. \param [in] nStorage Specify the current phonebook memory storage. This parameter can be one of the following value:
  5202. \rst
  5203. +---------------------------+----------------------------------+
  5204. | Memory Storage | Description |
  5205. +===========================+==================================+
  5206. | | SIM phonebook(storage depends on |
  5207. | CFW_PBK_SIM | SIM Card). |
  5208. +---------------------------+----------------------------------+
  5209. | | SIM fix dialing phonebook (FD |
  5210. | CFW_PBK_SIM_FIX_DIALLING | Phonebook storage). |
  5211. +---------------------------+----------------------------------+
  5212. | | SIM last-dialing-phonebook (LD |
  5213. | CFW_PBK_SIM_LAST_DIALLING | Phonebook storage). |
  5214. +---------------------------+----------------------------------+
  5215. | CFW_PBK_ON | Own numbers (MSISDNs) list. |
  5216. +---------------------------+----------------------------------+
  5217. | CFW_PBK_EN | Emergency Call storage |
  5218. +---------------------------+----------------------------------+
  5219. \endrst
  5220. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  5221. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  5222. module. This parameter should be less than 255 for all upper layer application.
  5223. \param [in] nSimID SIM ID
  5224. \return
  5225. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  5226. \rst
  5227. +----------------------------+-----------------------------------------+
  5228. | Error Code | Description |
  5229. +============================+=========================================+
  5230. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  5231. +----------------------------+-----------------------------------------+
  5232. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  5233. +----------------------------+-----------------------------------------+
  5234. | | The UTI is busy, maybe the UTI is used |
  5235. | ERR_CFW_UTI_IS_BUSY | by other instance. |
  5236. +----------------------------+-----------------------------------------+
  5237. | ERR_CME_UNKNOWN | Unknown error occur. |
  5238. +----------------------------+-----------------------------------------+
  5239. | ERR_NO_MORE_MEMORY | No more memory to allocated |
  5240. +----------------------------+-----------------------------------------+
  5241. \endrst
  5242. */
  5243. uint32_t CFW_SimGetPbkStrorageInfo(
  5244. uint8_t nStorage,
  5245. uint16_t nUTI,
  5246. CFW_SIM_ID nSimID);
  5247. /*! \brief The CFW_SimGetPbkStorage gets the current phone storage using statsus.
  5248. The result should be returned through the EV_CFW_SIM_GET_PBK_STRORAGE_RSP event:
  5249. \rst
  5250. +------+-------+--------------------------------+------------------------+-------------+
  5251. | UTI | nType | nParam1 | nParam2 | Description |
  5252. +======+=======+================================+========================+=============+
  5253. | | | Pointer to the CFW_PBK_STORAGE | | |
  5254. | nUTI | 0x00 | structure array. | size of this structure | OK |
  5255. +------+-------+--------------------------------+------------------------+-------------+
  5256. | nUTI | 0xF0 | SIM_Errors_Code | 0 | Error |
  5257. +------+-------+--------------------------------+------------------------+-------------+
  5258. \endrst
  5259. \param [in] nStorage Specify the current phonebook memory storage. This parameter can be one of the following value:
  5260. \rst
  5261. +---------------------------+----------------------------------+
  5262. | Memory Storage | Description |
  5263. +===========================+==================================+
  5264. | | SIM phonebook(storage depends on |
  5265. | CFW_PBK_SIM | SIM Card). |
  5266. +---------------------------+----------------------------------+
  5267. | | SIM fix dialing phonebook (FD |
  5268. | CFW_PBK_SIM_FIX_DIALLING | Phonebook storage). |
  5269. +---------------------------+----------------------------------+
  5270. | | SIM last-dialing-phonebook (LD |
  5271. | CFW_PBK_SIM_LAST_DIALLING | Phonebook storage). |
  5272. +---------------------------+----------------------------------+
  5273. | CFW_PBK_ON | Own numbers (MSISDNs) list. |
  5274. +---------------------------+----------------------------------+
  5275. | CFW_PBK_EN | Emergency Call storage |
  5276. +---------------------------+----------------------------------+
  5277. \endrst
  5278. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  5279. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  5280. module. This parameter should be less than 255 for all upper layer application.
  5281. \param [in] nSimID SIM ID
  5282. \return
  5283. If the function succeeds, the return value is ERR_SUCCESS, if the function fails, the following error code may be returned.
  5284. \rst
  5285. +----------------------------+-----------------------------------------+
  5286. | Error Code | Description |
  5287. +============================+=========================================+
  5288. | ERR_CFW_INVALID_PARAMETER | The input parameter(nIndex) is invalid. |
  5289. +----------------------------+-----------------------------------------+
  5290. | ERR_CFW_NOT_EXIST_FREE_UTI | No any available free UTI in the system |
  5291. +----------------------------+-----------------------------------------+
  5292. | | The UTI is busy, maybe the UTI is used |
  5293. | ERR_CFW_UTI_IS_BUSY | by other instance. |
  5294. +----------------------------+-----------------------------------------+
  5295. | ERR_CME_UNKNOWN | Unknown error occur. |
  5296. +----------------------------+-----------------------------------------+
  5297. | ERR_NO_MORE_MEMORY | No more memory to allocated |
  5298. +----------------------------+-----------------------------------------+
  5299. \endrst
  5300. */
  5301. uint32_t CFW_SimGetPbkStorage(
  5302. uint8_t nStorage,
  5303. uint16_t nUTI,
  5304. CFW_SIM_ID nSimID);
  5305. void CFW_SimSetProiorityResetFlag(
  5306. uint8_t nResetFlag);
  5307. uint32_t CFW_SimWritePreferPLMN(uint8_t index, uint8_t *operator, uint8_t nSize, uint16_t nUTI, CFW_SIM_ID nSimID);
  5308. uint32_t CFW_SimReadPreferPLMN(uint16_t nUTI, CFW_SIM_ID nSimID);
  5309. uint32_t CFW_SimSetSaveFileFlag(
  5310. uint8_t nFlag);
  5311. uint8_t CFW_SimGetSaveFileFlag(
  5312. void);
  5313. uint32_t CFW_SimSetSaveFileList(
  5314. uint8_t FileList[8],
  5315. uint8_t Num,
  5316. CFW_SIM_ID nSimID);
  5317. uint32_t CFW_SimGetFileUpdateCount(
  5318. uint8_t nFile,
  5319. CFW_SIM_ID nSimID);
  5320. uint32_t CFW_SimUpdateSaveFile(
  5321. uint8_t FileList[8],
  5322. uint8_t num,
  5323. uint16_t nUTI,
  5324. CFW_SIM_ID nSimID);
  5325. uint32_t CFW_SatActivation(
  5326. uint8_t nMode,
  5327. uint16_t nUTI,
  5328. CFW_SIM_ID nSimID);
  5329. uint32_t CFW_SatResponse(
  5330. uint8_t nCmdType,
  5331. uint8_t nStatus,
  5332. uint8_t nItemId,
  5333. void *pInputString,
  5334. uint8_t InputStrLen,
  5335. uint16_t nUTI,
  5336. CFW_SIM_ID nSimID);
  5337. uint32_t CFW_SatGetInformation(
  5338. uint8_t nCmdType,
  5339. void **pCmdData,
  5340. CFW_SIM_ID nSimID);
  5341. uint8_t CFW_SatGetCurCMD(CFW_SIM_ID nSimID);
  5342. void CFW_GetMNCLen(uint8_t *pLen, CFW_SIM_ID nSimID);
  5343. uint32_t CFW_CfgSimGetMeProfile(CFW_PROFILE *pMeProfile);
  5344. uint32_t CFW_CfgSimSetMeProfile(CFW_PROFILE *pMeProfile);
  5345. uint32_t CFW_CfgSetCdrxNoSleepEnable(uint8_t bEnable, CFW_SIM_ID nSimID);
  5346. uint8_t CFW_CfgGetCdrxNoSleepEnable(CFW_SIM_ID nSimID);
  5347. uint32_t CFW_CfgSetPeriodTauAftLocalRel(uint8_t bEnable, CFW_SIM_ID nSimID);
  5348. uint8_t CFW_CfgGetPeriodTauAftLocalRel(CFW_SIM_ID nSimID);
  5349. uint32_t CFW_CfgSetPocEnable(uint8_t bEnable);
  5350. uint8_t CFW_CfgGetPocEnable(void);
  5351. uint32_t CFW_CfgSetEnhancePwrSweepNonCE(uint8_t bEnable, CFW_SIM_ID nSimID);
  5352. uint8_t CFW_CfgGetEnhancePwrSweepNonCE(CFW_SIM_ID nSimID);
  5353. uint32_t CFW_NwSetSimSwich(uint8_t bOnGoing);
  5354. uint8_t CFW_NwGetSimSwitch(void);
  5355. uint32_t CFW_NwSetPocSimIndex(CFW_SIM_ID nSimID);
  5356. typedef struct
  5357. {
  5358. uint8_t Bitmap;
  5359. uint8_t reserved;
  5360. uint16_t Treselection;
  5361. uint16_t TreselectionB;
  5362. uint8_t ThreshAQ;
  5363. uint8_t ThreshAP;
  5364. uint8_t ThreshASINR;
  5365. uint8_t ThreshBQ;
  5366. uint8_t ThreshBP;
  5367. uint8_t ThreshBSINR;
  5368. uint16_t n;
  5369. uint16_t reserved2;
  5370. } CFW_EMOD_POC_PARA_T;
  5371. uint32_t CFW_EmodGetPocPara(CFW_EMOD_POC_PARA_T *pParam, CFW_SIM_ID nSimID);
  5372. uint32_t CFW_EmodSetPocPara(CFW_EMOD_POC_PARA_T *pParam, CFW_SIM_ID nSimID);
  5373. void CFW_EmodSetPSMThd(uint32_t nMinute);
  5374. uint32_t CFW_EmodGetPSMThd(void);
  5375. uint16_t CFW_EmodGetLpsFlag(void);
  5376. uint32_t CFW_SimGetICCID(uint16_t nUTI, CFW_SIM_ID nSimID);
  5377. // SAT
  5378. typedef struct _CFW_SAT_ITEM_LIST
  5379. {
  5380. uint8_t nItemID;
  5381. uint8_t nItemLen;
  5382. uint8_t padding[2];
  5383. uint8_t *pItemStr;
  5384. struct _CFW_SAT_ITEM_LIST *pNextItem;
  5385. } CFW_SAT_ITEM_LIST;
  5386. uint32_t CFW_SatGetStatus(
  5387. uint16_t nUTI);
  5388. uint8_t CFW_SimGetFileType(uint8_t FileID);
  5389. #define CFW_SIM_REFRESH_MAX_FILE_NUM 40
  5390. typedef struct
  5391. {
  5392. uint8_t file_num; //the file number in the file list
  5393. uint8_t file_arr[CFW_SIM_REFRESH_MAX_FILE_NUM]; //the file array
  5394. } CFW_SAT_REFRESH_FILE_CHG_REQ_T;
  5395. typedef struct
  5396. {
  5397. uint8_t file_name; //the file_name
  5398. uint8_t record_num; //the record number of the file
  5399. } CFW_SIM_FILE_INFO_T;
  5400. typedef struct
  5401. {
  5402. uint8_t result;
  5403. uint8_t file_num; //the file number in the file list
  5404. CFW_SIM_FILE_INFO_T file_info[CFW_SIM_REFRESH_MAX_FILE_NUM]; //the file info
  5405. } CFW_SAT_REFRESH_FILE_CHG_CNF_T;
  5406. uint32_t CFW_SatRefreshFileChange(
  5407. CFW_SAT_REFRESH_FILE_CHG_REQ_T FileChangeReq,
  5408. uint16_t nUTI,
  5409. CFW_SIM_ID nSimID);
  5410. // CC Network Error code
  5411. #define CFW_CC_CAUSE_NOUSED_CAUSE 0
  5412. #define CFW_CC_CAUSE_UNASSIGNED_NUMBER 1
  5413. #define CFW_CC_CAUSE_NO_ROUTE_IN_TRANSIT_NETWORK 2
  5414. #define CFW_CC_CAUSE_NO_ROUTE_TO_DESTINATION 3
  5415. #define CFW_CC_CAUSE_CHANNEL_UNACCEPTABLE 6
  5416. #define CFW_CC_CAUSE_CALL_AWARDED 7
  5417. #define CFW_CC_CAUSE_OPERATOR_DETERMINED_BARRING 8
  5418. #define CFW_CC_CAUSE_NORMAL_CALL_CLEARING 16
  5419. #define CFW_CC_CAUSE_USER_BUSY 17
  5420. #define CFW_CC_CAUSE_NO_USER_RESPONDING 18
  5421. #define CFW_CC_CAUSE_USER_ALERTING_NO_ANSWER 19
  5422. #define CFW_CC_CAUSE_CALL_REJECTED 21
  5423. #define CFW_CC_CAUSE_NUMBER_CHANGED 22
  5424. #define CFW_CC_CAUSE_PRE_EMPTION 25
  5425. #define CFW_CC_CAUSE_NON_SELECTED_USER_CLEARING 26
  5426. #define CFW_CC_CAUSE_DESTINATION_OUT_OF_ORDER 27
  5427. #define CFW_CC_CAUSE_INVALID_NUMBER_FORMAT 28
  5428. #define CFW_CC_CAUSE_FACILITY_REJECTED 29
  5429. #define CFW_CC_CAUSE_RESPONSE_TO_STATUS_ENQUIRY 30
  5430. #define CFW_CC_CAUSE_NORMAL_UNSPECIFIED 31
  5431. #define CFW_CC_CAUSE_NO_CIRCUIT_CHANNEL_AVAILABLE 34
  5432. #define CFW_CC_CAUSE_NETWORK_OUT_OF_ORDER 38
  5433. #define CFW_CC_CAUSE_TEMPORARY_FAILURE 41
  5434. #define CFW_CC_CAUSE_SWITCHING_EQUIPMENT_CONGESTION 42
  5435. #define CFW_CC_CAUSE_ACCESS_INFORMATION_DISCARDED 43
  5436. #define CFW_CC_CAUSE_CHANNEL_UNAVAILABLE 44
  5437. #define CFW_CC_CAUSE_RESOURCES_UNAVAILABLE 47
  5438. #define CFW_CC_CAUSE_QOS_UNAVAILABLE 49
  5439. #define CFW_CC_CAUSE_FACILITY_NOT_SUBSCRIBED 50
  5440. #define CFW_CC_CAUSE_MT_CALLS_BARRED 55
  5441. #define CFW_CC_CAUSE_BC_NOT_AUTHORIZED 57
  5442. #define CFW_CC_CAUSE_BC_NOT_PRESENTLY_AVAILABLE 58
  5443. #define CFW_CC_CAUSE_SERVICE_UNAVAILABLE 63
  5444. #define CFW_CC_CAUSE_BEARER_SERVICE_NOT_IMPLEMENTED 65
  5445. #define CFW_CC_CAUSE_CHANNEL_NOT_IMPLEMENTED 66
  5446. #define CFW_CC_CAUSE_ACM_EQUAL_TO_OR_GREATER_THAN_ACMMAX 68
  5447. #define CFW_CC_CAUSE_REQUESTED_FACILITY_NOT_IMPLEMENTED 69
  5448. #define CFW_CC_CAUSE_ONLY_RESTRICTED_DIGITAL_INFORMATION_BC_AVAILABLE 70
  5449. #define CFW_CC_CAUSE_SERVICE_NOT_IMPLEMENTED 71
  5450. #define CFW_CC_CAUSE_INVALID_TI_VALUE 81
  5451. #define CFW_CC_CAUSE_CHANNEL_DOES_NOT_EXIST 82
  5452. #define CFW_CC_CAUSE_CALL_IDENTITY_DOESNT_EXIST 83
  5453. #define CFW_CC_CAUSE_CALL_IDENTITY_IN_USE 84
  5454. #define CFW_CC_CAUSE_NO_CALL_SUSPENDED 85
  5455. #define CFW_CC_CAUSE_CALL_CLEARED 86
  5456. #define CFW_CC_CAUSE_USER_NOT_MEMBER_OF_CUG 87
  5457. #define CFW_CC_CAUSE_INCOMPATIBLE_DESTINATION 88
  5458. #define CFW_CC_CAUSE_INVALID_TRANSIT_NETWORK 91
  5459. #define CFW_CC_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE 94
  5460. #define CFW_CC_CAUSE_INVALID_MESSAGE 95
  5461. #define CFW_CC_CAUSE_INVALID_MANDATORY_INFORMATION 96
  5462. #define CFW_CC_CAUSE_MESSAGE_TYPE_NOT_IMPLEMENTED 97
  5463. #define CFW_CC_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE 98
  5464. #define CFW_CC_CAUSE_IE_NOT_IMPLEMENTED 99
  5465. #define CFW_CC_CAUSE_CONDITIONAL_IE_ERROR 100
  5466. #define CFW_CC_CAUSE_MESSAGE_NOT_COMPATIBLE 101
  5467. #define CFW_CC_CAUSE_RECOVERY_ON_TIMER_EXPIRY 102
  5468. #define CFW_CC_CAUSE_PROTOCOL_ERROR_UNSPECIFIED 111
  5469. #define CFW_CC_CAUSE_INTERWORKING_UNSPECIFIED 127
  5470. #define CFW_CM_CAUSE_SUCCESS 255
  5471. // CC local error
  5472. #define CFW_CC_ERR_NORMAL_RELEASE 0
  5473. #define CFW_CC_ERR_LOW_LAYER_FAIL 1
  5474. #define CFW_CC_ERR_REQUEST_IMPOSSIBLE 2
  5475. #define CFW_CC_ERR_INCOMING_CALL_BARRED 3
  5476. #define CFW_CC_ERR_OUTGOING_CALL_BARRED 4
  5477. #define CFW_CC_ERR_CALL_HOLD_REJECTED 5
  5478. #define CFW_CC_ERR_CALL_RTRV_REJECTED 6
  5479. #define CFW_CC_ERR_CC_TIMER_EXPIRY 7
  5480. #define CFW_CC_ERR_CC_PROTOCOL_ERROR 8
  5481. #define CFW_CC_ERR_NOT_USED 0xff
  5482. // Crss error
  5483. #define CFW_CRSS_ERR_RETURN_ERROR 0x0002
  5484. #define CFW_CRSS_ERR_GENERAL_PROBLEM_UNRECOGNIZED_COMPONENT 0x8000
  5485. #define CFW_CRSS_ERR_GENERAL_PROBLEM_MISTYPED_COMPONENT 0x8001
  5486. #define CFW_CRSS_ERR_GENERAL_PROBLEM_BADLY_STRUCTURED_COMPONENT 0x8002
  5487. #define CFW_CRSS_ERR_INVOKE_PROBLEM_DUPLICATE_INVOKE_ID 0x8100
  5488. #define CFW_CRSS_ERR_INVOKE_PROBLEM_UNRECOGNIZED_OPERATION 0x8101
  5489. #define CFW_CRSS_ERR_INVOKE_PROBLEM_MISTYPED_PARAMETER 0x8102
  5490. #define CFW_CRSS_ERR_INVOKE_PROBLEM_RESOURCE_LIMITATION 0x8103
  5491. #define CFW_CRSS_ERR_INVOKE_PROBLEM_INITIATING_RELEASE 0x8104
  5492. #define CFW_CRSS_ERR_INVOKE_PROBLEM_UNRECOGNIZED_LINKED_ID 0x8105
  5493. #define CFW_CRSS_ERR_INVOKE_PROBLEM_LINKED_RESPONSE_UNEXPECTED 0x8106
  5494. #define CFW_CRSS_ERR_INVOKE_PROBLEM_UNEXPECTED_LINKED_OPERATION 0x8107
  5495. #define CFW_CRSS_ERR_RETURN_RESULT_PROBLEM_UNRECOGNIZED_INVOKE_ID 0x8200
  5496. #define CFW_CRSS_ERR_RETURN_RESULT_PROBLEM_RETURN_RESULT_UNEXPECTED 0x8201
  5497. #define CFW_CRSS_ERR_RETURN_RESULT_PROBLEM_MISTYPED_PARAMETER 0x8202
  5498. #define CFW_CRSS_ERR_RETURN_ERROR_PROBLEM_UNRECOGNIZED_INVOKE_ID 0x8300
  5499. #define CFW_CRSS_ERR_RETURN_ERROR_PROBLEM_RETURN_ERROR_UNEXPECTED 0x8301
  5500. #define CFW_CRSS_ERR_RETURN_ERROR_PROBLEM_UNRECOGNIZED_ERROR 0x8302
  5501. #define CFW_CRSS_ERR_RETURN_ERROR_PROBLEM_UNEXPECTED_ERROR 0x8303
  5502. #define CFW_CRSS_ERR_RETURN_ERROR_PROBLEM_MISTYPED_PARAMETER 0x8304
  5503. //SS code
  5504. #define CFW_SS_NO_CODE
  5505. #define CFW_SS_CLIP 30 ///< CLIP
  5506. #define CFW_SS_CLIR 31 ///< CLIR
  5507. #define CFW_SS_COLP 76 ///< COLP
  5508. #define CFW_SS_COLR 77 ///< COLR
  5509. #define CFW_SS_CNAP 300 ///< CNAP
  5510. #define CFW_SS_CFA 2 ///< All forwarding
  5511. #define CFW_SS_CFU 21 ///< CF unconditional
  5512. #define CFW_SS_CD 66 ///< call deflection
  5513. #define CFW_SS_CFC 4 ///< CF conditional
  5514. #define CFW_SS_CFB 67 ///< CF on MS busy
  5515. #define CFW_SS_CFNRY 61 ///< CF on MS no reply
  5516. #define CFW_SS_CFNRC 62 ///< CF on MS not reachable
  5517. #define CFW_SS_USSD_V2 100 ///< USSD version 2 services supports
  5518. // all USSD Operations except
  5519. // ss_ProcessUnstructuredSSData
  5520. #define CFW_SS_USSD_V1 101 ///< USSD version 1 services supports
  5521. // ss_ProcessUnstructuredSSData
  5522. // Operations Only
  5523. #define CFW_SS_ECT 96 ///< explicit call transfer
  5524. #define CFW_SS_CW 43 ///< call waiting
  5525. #define CFW_SS_HOLD 102 ///< call hold (defined by CIITEC)
  5526. #define CFW_SS_MPTY 103 ///< multiparty (defined by CIITEC)
  5527. #define CFW_SS_AOCI 104 ///< advice of charge information (defined by CIITEC)
  5528. #define CFW_SS_AOCC 105 ///< advice of charge charging (defined by CIITEC)
  5529. #define CFW_SS_UUS1 361 ///< uus1
  5530. #define CFW_SS_UUS2 362 ///< uus2
  5531. #define CFW_SS_UUS3 363 ///< uus3
  5532. #define CFW_SS_AllBarringSS 330 ///< all call barring
  5533. #define CFW_SS_BarringOfOutgoingCalls 333 ///< barring of MO call
  5534. #define CFW_SS_BAOC 33 ///< barring of all MO call
  5535. #define CFW_SS_BOIC 331 ///< barring of international MO call
  5536. #define CFW_SS_BOIC_ExHC 332 ///< barring of international MO call
  5537. // except those going to the home plmn
  5538. #define CFW_SS_BarringOfIncomingCalls 353 ///< barring of MT call
  5539. #define CFW_SS_BAIC 35 ///< barring of all MT call
  5540. #define CFW_SS_BIC_ROAM 351 ///< barring of MT call when roaming
  5541. // outside of home plmn
  5542. //SS operation code
  5543. #define CFW_SS_REGISTER 10 ///< register a SS valid for CF
  5544. #define CFW_SS_ERASURE 11 ///< erase a SS valid for CF
  5545. #define CFW_SS_ACTIVATE 12 ///< activate a SS valid for all
  5546. // SS operations except line
  5547. // identification
  5548. #define CFW_SS_DEACTIVATE 13 ///< deactivate a SS valid for all
  5549. // SS operations except line
  5550. // identification
  5551. #define CFW_SS_INTERROGATE 14 ///< interrogate a SS
  5552. #define CFW_SS_NOTIFY 16
  5553. #define CFW_SS_REGISTERPASSWORD 17 ///< register a password valid for CB
  5554. #define CFW_SS_GETCALLBARRINGPASSWORD 18 ///< this operation is invoked by
  5555. // network only
  5556. #define CFW_SS_PROCESSUNSTRUCTUREDSSDATA 19 ///< This operation is used only
  5557. // for USSD Version 1
  5558. #define CFW_SS_PROCESSUNSTRUCTUREDSSREQUEST 59 ///< This operation is used only
  5559. // for USSD Version 2
  5560. #define CFW_SS_UNSTRUCTUREDSSREQUEST 60 ///< This operation is used only
  5561. // for USSD Version 2
  5562. #define CFW_SS_UNSTRUCTUREDSSNOTIFY 61 ///< This operation is used only
  5563. // for USSD Version 2
  5564. #define CFW_SS_CALLDEFLECTION 117
  5565. #define CFW_SS_USERUSERSERVICE 118
  5566. #define CFW_SS_SPLITMPTY 121
  5567. #define CFW_SS_RETRIEVEMPTY 122
  5568. #define CFW_SS_HOLDMPTY 123
  5569. #define CFW_SS_BUILDMPTY 124
  5570. #define CFW_SS_FORWARDCHARGEADVICE 125
  5571. #define CFW_SS_EXPLICITCT 126
  5572. //
  5573. // PBK Services
  5574. //
  5575. #define CFW_PBK_DATA_MAX_SIZE 20
  5576. #define PBK_SIM_NUMBER_SIZE SIM_PBK_NUMBER_SIZE
  5577. #define CFW_PBK_NAME_MAX_SIZE 20
  5578. #define CFW_PBK_NUMBER_MAX_SIZE 20 ///< BCD
  5579. #define PBK_HINT_SIZE 16
  5580. typedef struct _CFW_PBK_ENTRY_SIMPLE_HRD
  5581. {
  5582. uint16_t nPosition;
  5583. uint8_t nStorageId;
  5584. uint8_t nNameSize;
  5585. uint8_t nNumberSize;
  5586. uint8_t nNumberType;
  5587. uint8_t padding[2];
  5588. uint8_t *pName;
  5589. uint8_t *pNumber;
  5590. } CFW_PBK_ENTRY_SIMPLE_HRD;
  5591. typedef struct _CFW_PBK_ENTRY_HRD
  5592. {
  5593. uint16_t nPosition;
  5594. uint16_t nAppIndex;
  5595. uint8_t *pName;
  5596. uint8_t *pNumber;
  5597. uint8_t nNameSize;
  5598. uint8_t nNumberSize;
  5599. uint8_t nNumberType;
  5600. uint8_t nStorageId;
  5601. uint32_t nItemGroupType;
  5602. uint32_t nGroup;
  5603. } CFW_PBK_ENTRY_HRD;
  5604. typedef struct _CFW_PBK_ENTRY_ITEM
  5605. {
  5606. uint32_t nPosition;
  5607. uint32_t nItemType;
  5608. uint32_t nItemId;
  5609. uint8_t *pItemName;
  5610. uint8_t *pItemData;
  5611. uint8_t nItemNameSize;
  5612. uint8_t nItemDataSize;
  5613. uint8_t nDataType;
  5614. uint8_t padding;
  5615. } CFW_PBK_ENTRY_ITEM;
  5616. typedef struct _CFW_PBK_DETAIL_ENTRY
  5617. {
  5618. CFW_PBK_ENTRY_HRD sHeader;
  5619. uint32_t iItemNum;
  5620. CFW_PBK_ENTRY_ITEM *pItemArray;
  5621. } CFW_PBK_DETAIL_ENTRY;
  5622. #define CFW_PBK_SEARCH_NAME_FIRST_MATCH 0x01
  5623. #define CFW_PBK_SEARCH_NAME_FULL_MATCH 0x02
  5624. #define CFW_PBK_SEARCH_NAME_PY_MATCH 0x04
  5625. #define CFW_PBK_SEARCH_NUM_FIRST_MATCH 0x08
  5626. #define CFW_PBK_SEARCH_NUM_NEXT_MATCH 0x10
  5627. #define CFW_PBK_SEARCH_ENTRY_SIMPLE_INFO 0x20
  5628. #define CFW_PBK_SEARCH_ENTRY_HEADER_INFO 0x40
  5629. #define CFW_PBK_SEARCH_ENTRY_FULL_INFO 0x80
  5630. #define CFW_PBK_OPTION_ENTRY_SIMPLE_HEADER 0x01
  5631. #define CFW_PBK_OPTION_ENTRY_FULL_HEADER 0x02
  5632. #define CFW_PBK_OPTION_ENTRY_ITEM 0x04
  5633. #define CFW_PBK_COPY_ME2SM 0x00
  5634. #define CFW_PBK_COPY_SM2ME 0x01
  5635. #define CFW_PBK_COPY_ME2SM_STEP 0x02
  5636. #define CFW_PBK_COPY_SM2ME_STEP 0x04
  5637. #define CFW_PBK_ITEM_TYPE_PHONE_NUMBER 0x1 ///< Specify the phone number such as mobile number or home number or office numberW
  5638. #define CFW_PBK_ITEM_TYPE_EAMIL 0x2 //
  5639. #define CFW_PBK_ITEM_TYPE_ADDERSS 0x4 //
  5640. #define CFW_PBK_ITEM_TYPE_WEBSITE 0x8 //
  5641. #define CFW_PBK_ITEM_TYPE_STRING 0x10 //
  5642. #define CFW_PBK_ITEM_TYPE_RES_ID 0x20 ///< Specify the resource identifier
  5643. #define CFW_PBK_ITEM_TYPE_RES_PATH 0x40 ///< Specify the resource identifier or resource file path such as icon name.
  5644. typedef struct _CFW_PBK_CAPACITY_INFO
  5645. {
  5646. uint16_t nTotalNum;
  5647. uint8_t nPhoneNumberLen;
  5648. uint8_t nTextLen;
  5649. uint16_t nUsedNum;
  5650. uint8_t nStorageId;
  5651. uint8_t padding;
  5652. } CFW_PBK_CAPACITY_INFO;
  5653. typedef struct _CFW_PBK_CALLLOG_ENTRY
  5654. {
  5655. uint8_t *pNumber;
  5656. uint8_t nNumberSize;
  5657. uint8_t nNumberType;
  5658. uint16_t nPosition;
  5659. uint8_t nTimes;
  5660. uint8_t nStorageId;
  5661. uint16_t nDuration;
  5662. uint32_t nStartTime;
  5663. } CFW_PBK_CALLLOG_ENTRY;
  5664. #ifdef CFW_PBK_SYNC_VER
  5665. // Synchronous Function for PBK.
  5666. typedef struct _CFW_PBK_OUT_PARAM
  5667. {
  5668. uint8_t nType;
  5669. uint8_t padding[3];
  5670. uint32_t nParam1;
  5671. uint32_t nParam2;
  5672. } CFW_PBK_OUT_PARAM;
  5673. uint32_t CFW_PbkAddEntry(
  5674. CFW_PBK_ENTRY_HRD *pEntryHrd,
  5675. CFW_PBK_OUT_PARAM *pOutParam);
  5676. uint32_t CFW_PbkUpdateEntry(
  5677. CFW_PBK_ENTRY_HRD *pEntryHrd,
  5678. CFW_PBK_OUT_PARAM *pOutParam);
  5679. uint32_t CFW_PbkDeleteEntry(
  5680. uint8_t nStorageId,
  5681. uint16_t nPosition,
  5682. CFW_PBK_OUT_PARAM *pOutParam);
  5683. uint32_t CFW_PbkDeleteBatchEntries(
  5684. uint16_t nStartPos,
  5685. uint16_t nCount,
  5686. uint8_t nStorageId,
  5687. CFW_PBK_OUT_PARAM *pOutParam);
  5688. uint32_t CFW_PbkFindEntry(
  5689. uint8_t *pString,
  5690. uint8_t nStringSize,
  5691. uint16_t nStartPos,
  5692. uint16_t nCount,
  5693. uint8_t nStorageId,
  5694. uint16_t nGroup,
  5695. uint16_t nOption,
  5696. CFW_PBK_OUT_PARAM *pOutParam);
  5697. uint32_t CFW_PbkListEntries(
  5698. uint16_t nStartPos,
  5699. uint16_t nPageCount,
  5700. uint16_t nSkipPage,
  5701. uint8_t nStorageId,
  5702. uint16_t nGroup,
  5703. uint8_t nOption,
  5704. CFW_PBK_OUT_PARAM *pOutParam);
  5705. uint32_t CFW_PbkGetEntry(
  5706. uint16_t nPosition,
  5707. uint8_t nStorageId,
  5708. uint8_t nOption,
  5709. CFW_PBK_OUT_PARAM *pOutParam);
  5710. uint32_t CFW_PbkCopyEntries(
  5711. uint16_t nStartPos,
  5712. uint16_t nCount,
  5713. uint8_t nOption,
  5714. uint16_t nUTI);
  5715. uint32_t CFW_PbkAddEntryItem(
  5716. CFW_PBK_ENTRY_ITEM *pEntryItem,
  5717. uint8_t nCount,
  5718. CFW_PBK_OUT_PARAM *pOutParam);
  5719. uint32_t CFW_PbkGetEntryItems(
  5720. uint16_t nPosition,
  5721. uint32_t nItemGroupType,
  5722. CFW_PBK_OUT_PARAM *pOutParam);
  5723. uint32_t CFW_PbkDeleteEntryItem(
  5724. uint16_t nItemId,
  5725. /*uint32_t nItemGroupType,*/
  5726. CFW_PBK_OUT_PARAM *pOutParam);
  5727. uint32_t CFW_PbkGetCapacityInfo(
  5728. uint8_t nStorageId,
  5729. CFW_PBK_CAPACITY_INFO *pCapInfo);
  5730. uint32_t CFW_PbkGetCalllogCapacityInfo(
  5731. uint8_t nStorageId,
  5732. CFW_PBK_CAPACITY_INFO *pCapInfo);
  5733. uint32_t CFW_PbkAddCallLogEntry(
  5734. CFW_PBK_CALLLOG_ENTRY *pEntryInfo,
  5735. CFW_PBK_OUT_PARAM *pOutParam);
  5736. uint32_t CFW_PbkGetCallLogEntry(
  5737. uint16_t nPosition,
  5738. uint8_t nStorageId,
  5739. CFW_PBK_OUT_PARAM *pOutParam);
  5740. uint32_t CFW_PbkListCallLogEntries(
  5741. uint16_t nStartPosition,
  5742. uint16_t nCount,
  5743. uint8_t nStorage,
  5744. CFW_PBK_OUT_PARAM *pOutParam);
  5745. uint32_t CFW_PbkDeleteBatchCallLogEntries(
  5746. uint16_t nStartPos,
  5747. uint16_t nCount,
  5748. uint8_t nStorageId,
  5749. CFW_PBK_OUT_PARAM *pOutParam);
  5750. uint32_t CFW_PbkGetCalllogCapacityInfo(
  5751. uint8_t nStorageId,
  5752. CFW_PBK_CAPACITY_INFO *pCapInfo);
  5753. #else
  5754. uint32_t CFW_PbkAddEntry(
  5755. CFW_PBK_ENTRY_HRD *pEntryHrd,
  5756. uint16_t nUTI);
  5757. uint32_t CFW_PbkUpdateEntry(
  5758. CFW_PBK_ENTRY_HRD *pEntryHrd,
  5759. uint16_t nUTI);
  5760. uint32_t CFW_PbkDeleteEntry(
  5761. uint8_t nStorageId,
  5762. uint16_t nPosition,
  5763. uint16_t nUTI);
  5764. uint32_t CFW_PbkDeleteBatchEntries(
  5765. uint16_t nStartPos,
  5766. uint16_t nCount,
  5767. uint8_t nStorageId,
  5768. uint16_t nUTI);
  5769. uint32_t CFW_PbkFindEntry(
  5770. uint8_t *pString,
  5771. uint8_t nStringSize,
  5772. uint16_t nStartPos,
  5773. uint16_t nCount,
  5774. uint8_t nStorageId,
  5775. uint16_t nGroup,
  5776. uint16_t nOption,
  5777. uint16_t nUTI);
  5778. uint32_t CFW_PbkListEntries(
  5779. uint16_t nStartPos,
  5780. uint16_t nPageCount,
  5781. uint16_t nSkipPage,
  5782. uint8_t nStorageId,
  5783. uint16_t nGroup,
  5784. uint8_t nOption,
  5785. uint16_t nUTI);
  5786. uint32_t CFW_PbkGetEntry(
  5787. uint16_t nPosition,
  5788. uint8_t nStorageId,
  5789. uint8_t nOption,
  5790. uint16_t nUTI);
  5791. uint32_t CFW_PbkCopyEntries(
  5792. uint16_t nStartPos,
  5793. uint16_t nCount,
  5794. uint8_t nOption,
  5795. uint16_t nUTI);
  5796. uint32_t CFW_PbkAddEntryItem(
  5797. CFW_PBK_ENTRY_ITEM *pEntryItem,
  5798. uint8_t nCount,
  5799. uint16_t nUTI);
  5800. uint32_t CFW_PbkGetEntryItems(
  5801. uint16_t nPosition,
  5802. uint32_t nItemGroupType,
  5803. uint16_t nUTI);
  5804. uint32_t CFW_PbkDeleteEntryItem(
  5805. uint16_t nItemId,
  5806. uint16_t nUTI);
  5807. uint32_t CFW_PbkGetCapacityInfo(
  5808. uint8_t nStorageId,
  5809. CFW_PBK_CAPACITY_INFO *pCapInfo);
  5810. uint32_t CFW_PbkGetCalllogCapacityInfo(
  5811. uint8_t nStorageId,
  5812. CFW_PBK_CAPACITY_INFO *pCapInfo);
  5813. uint32_t CFW_PbkAddCallLogEntry(
  5814. CFW_PBK_CALLLOG_ENTRY *pEntryInfo,
  5815. uint16_t nUTI);
  5816. uint32_t CFW_PbkGetCallLogEntry(
  5817. uint16_t nPosition,
  5818. uint16_t nUTI);
  5819. uint32_t CFW_PbkListCallLogEntries(
  5820. uint16_t nStartPosition,
  5821. uint16_t nCount,
  5822. uint8_t nStorage,
  5823. uint16_t nUTI);
  5824. uint32_t CFW_PbkDeleteBatchCallLogEntries(
  5825. uint16_t nStartPos,
  5826. uint16_t nCount,
  5827. uint8_t nStorageId,
  5828. uint16_t nUTI);
  5829. uint32_t CFW_PbkGetCalllogCapacityInfo(
  5830. uint8_t nStorageId,
  5831. CFW_PBK_CAPACITY_INFO *pCapInfo);
  5832. uint32_t CFW_PbkCancel(
  5833. uint16_t nOption,
  5834. uint16_t nUTI);
  5835. #endif
  5836. //
  5837. // GPRS
  5838. //
  5839. #define CFW_GPRS_DETACHED 0 ///< detached
  5840. #define CFW_GPRS_ATTACHED 1 ///< attached
  5841. #define CFW_GPRS_DEACTIVED 0 ///< deactivated
  5842. #define CFW_GPRS_ACTIVED 1 ///< activated
  5843. // error define
  5844. #define ERR_CFW_GPRS_INVALID_CID 0
  5845. #define ERR_CFW_GPRS_HAVE_ACTIVED 1
  5846. #define ERR_CFW_GPRS_HAVE_DEACTIVED 2 //add wuys 2008-06-03
  5847. // state self defined
  5848. #define CFW_GPRS_STATE_IDLE 0
  5849. #define CFW_GPRS_STATE_CONNECTING 2
  5850. #define CFW_GPRS_STATE_DISCONNECTING 3
  5851. #define CFW_GPRS_STATE_ACTIVE 4
  5852. #define CFW_GPRS_STATE_MODIFYING 5
  5853. #define CFW_GPRS_STATE_EPS_ALLOCATING 6
  5854. #define CFW_GPRS_STATE_ERROR 7
  5855. // Packet Data Protocol type
  5856. #define CFW_GPRS_PDP_TYPE_X25 0 ///< x.25
  5857. #define CFW_GPRS_PDP_TYPE_IP 1 ///< IP
  5858. #define CFW_GPRS_PDP_TYPE_IPV6 2 ///< IP Version 6
  5859. #define CFW_GPRS_PDP_TYPE_IPV4V6 3 ///< DualStack
  5860. #define CFW_GPRS_PDP_TYPE_UNUSED 4 ///< according to TS24.301 R14 9.9.4.10, shall be interpreted as "IPV6" if received by the network, here reserved
  5861. #define CFW_GPRS_PDP_TYPE_OSPIH 1 ///< internet Hosted Octect Stream Protocol
  5862. #define CFW_GPRS_PDP_TYPE_PPP 6 ///< Point to Point Protocol
  5863. /*added by zuohuaxu 20161115, begin*/
  5864. #if (defined LTE_NBIOT_SUPPORT) || (defined LTE_SUPPORT)
  5865. #define CFW_GPRS_PDP_TYPE_NONIP 5 /*value set according to TS24.301 R14 9.9.4.10*/
  5866. #endif
  5867. /*added by zuohuaxu 20161115, end*/
  5868. // PDP data compression
  5869. #define CFW_GPRS_PDP_D_COMP_OFF 0 ///< off (default if value is omitted)
  5870. #define CFW_GPRS_PDP_D_COMP_ON 1 ///< on(manufacturer preferred compression)
  5871. #define CFW_GPRS_PDP_D_COMP_V42 2 ///< V.42bis
  5872. #define CFW_GPRS_PDP_D_COMP_V44 3 ///< V.44
  5873. // PDP header compression
  5874. #define CFW_GPRS_PDP_H_COMP_OFF 0 ///< off (default if value is omitted)
  5875. #define CFW_GPRS_PDP_H_COMP_ON 1 ///< on (manufacturer preferred compression)
  5876. #define CFW_GPRS_PDP_H_COMP_RFC1144 2 ///< RFC1144 (applicable for SNDCP only)
  5877. #define CFW_GPRS_PDP_H_COMP_RFC2507 3 ///< RFC2507
  5878. #define CFW_GPRS_PDP_H_COMP_RFC3095 4 ///< RFC3095 (applicable for PDCP only)
  5879. //L2P
  5880. #define CFW_GPRS_L2P_NULL 0 ///< NULL (Obsolete)
  5881. #define CFW_GPRS_L2P_PPP 1 ///< PPP
  5882. #define CFW_GPRS_L2P_PAD 2 ///< PAD (Obsolete)
  5883. #define CFW_GPRS_L2P_X25 3 ///< x25 (Obsolete)
  5884. // Automatic response to a network request for PDP context activation
  5885. #define CFW_GPRS_AUTO_RESPONSE_PACKET_DOMAIN_OFF 0 ///< turn off automatic response for Packet Domain only
  5886. #define CFW_GPRS_AUTO_RESPONSE_PACKET_DOMAIN_ON 1 ///< turn on automatic response for Packet Domain only
  5887. #define CFW_GPRS_AUTO_RESPONSE_PS_ONLY 2 ///< modem compatibility mode, Packet Domain only
  5888. #define CFW_GPRS_AUTO_RESPONSE_PS_CS 3 ///< modem compatibility mode, Packet Domain and circuit switched calls (default)
  5889. #define THE_APN_MAX_LEN 99
  5890. #define THE_PDP_ADDR_MAX_LEN 21
  5891. #define THE_APN_USER_MAX_LEN 64
  5892. #define THE_APN_PWD_MAX_LEN 64
  5893. #define THE_PDP_DNS_MAX_LEN 21 ///< 0-3: IPV4 4-19:IPV6
  5894. #define THE_PDP_DNS_NUM 2
  5895. #if defined(CFW_GPRS_SUPPORT) || defined(DOXYGEN)
  5896. typedef struct _CFW_GPRS_PDPCONT_INFO
  5897. {
  5898. uint8_t nPdpType;
  5899. uint8_t nDComp;
  5900. uint8_t nHComp;
  5901. uint8_t nApnSize;
  5902. uint8_t nIpType;
  5903. //#ifdef CFW_VOLTE_SUPPORT //quectel modify
  5904. uint8_t nPcscfType[MAX_PCSCF_ADDR_NUMBER];
  5905. uint8_t nPcscfNumber;
  5906. uint8_t PcscfAddr[16 * MAX_PCSCF_ADDR_NUMBER];
  5907. uint8_t nIsEmergency;
  5908. //#endif //quectel modify
  5909. uint8_t nDnsType;
  5910. uint8_t nPdpDnsSize;
  5911. uint8_t *pPdpDns;
  5912. uint8_t nPdpAddrSize;
  5913. uint8_t nApnUserSize;
  5914. uint8_t nApnPwdSize;
  5915. uint8_t padding[1];
  5916. uint8_t *pApnUser;
  5917. uint8_t *pApnPwd;
  5918. uint8_t *pApn;
  5919. uint8_t *pPdpAddr;
  5920. uint8_t nNSLPI;
  5921. #if (defined LTE_NBIOT_SUPPORT) || (defined LTE_SUPPORT)
  5922. uint8_t PdnType; ///< IPV4/V6/Non-IP
  5923. #endif
  5924. uint8_t nAuthProt;
  5925. } CFW_GPRS_PDPCONT_INFO;
  5926. typedef struct
  5927. {
  5928. uint8_t nPdpType;
  5929. uint8_t nDComp;
  5930. uint8_t nHComp;
  5931. uint8_t nApnSize;
  5932. uint8_t nIpType;
  5933. uint8_t nPcscfType[MAX_PCSCF_ADDR_NUMBER];
  5934. uint8_t nPcscfNumber;
  5935. uint8_t PcscfAddr[16 * MAX_PCSCF_ADDR_NUMBER];
  5936. uint8_t nIsEmergency;
  5937. uint8_t nDnsType;
  5938. uint8_t nPdpDnsSize;
  5939. uint8_t pPdpDns[THE_PDP_DNS_MAX_LEN * THE_PDP_DNS_NUM];
  5940. uint8_t nPdpAddrSize;
  5941. uint8_t nApnUserSize;
  5942. uint8_t nApnPwdSize;
  5943. uint8_t pApnUser[THE_APN_USER_MAX_LEN];
  5944. uint8_t pApnPwd[THE_APN_PWD_MAX_LEN];
  5945. uint8_t pApn[THE_APN_MAX_LEN];
  5946. uint8_t pPdpAddr[THE_PDP_ADDR_MAX_LEN];
  5947. uint8_t nNSLPI;
  5948. uint8_t PdnType; ///< IPV4/V6/Non-IP
  5949. uint8_t nAuthProt;
  5950. } CFW_GPRS_PDPCONT_INFO_V2;
  5951. typedef struct
  5952. {
  5953. uint8_t nApnSize;
  5954. uint8_t pApn[THE_APN_MAX_LEN];
  5955. } CFW_GPRS_DYNAMIC_APN_INFO;
  5956. typedef struct
  5957. {
  5958. uint8_t nPdpAddrSize;
  5959. uint8_t pPdpAddr[THE_PDP_ADDR_MAX_LEN];
  5960. } CFW_GPRS_DYNAMIC_IP_INFO;
  5961. typedef struct
  5962. {
  5963. uint8_t nPdpType;
  5964. uint8_t nAuthProt;
  5965. uint8_t nApnSize;
  5966. uint8_t nApnUserSize;
  5967. uint8_t nApnPwdSize;
  5968. uint8_t pApnUser[THE_APN_USER_MAX_LEN];
  5969. uint8_t pApnPwd[THE_APN_PWD_MAX_LEN];
  5970. uint8_t pApn[THE_APN_MAX_LEN];
  5971. } CFW_GPRS_DFTPDN_INFO;
  5972. typedef struct
  5973. {
  5974. uint8_t Cid;
  5975. uint8_t nPdpType;
  5976. uint8_t PDPAddLen;
  5977. uint8_t PDPAddress[THE_PDP_ADDR_MAX_LEN];
  5978. uint8_t APNLen;
  5979. uint8_t AccessPointName[THE_APN_MAX_LEN];
  5980. } CFW_GPRS_PDPCONT_DFTPDN_INFO;
  5981. typedef struct _CFW_GPRS_QOS
  5982. {
  5983. uint8_t nPrecedence;
  5984. uint8_t nDelay;
  5985. uint8_t nReliability;
  5986. uint8_t nPeak;
  5987. uint8_t nMean;
  5988. uint8_t padding[3];
  5989. #if (defined LTE_NBIOT_SUPPORT) || (defined LTE_SUPPORT)
  5990. uint16_t nTrafficClass;
  5991. uint16_t nMaximumbitrateUL;
  5992. uint16_t nMaximumbitrateDL;
  5993. uint16_t nGuaranteedbitrateUL;
  5994. uint16_t nGuaranteedbitrateDL;
  5995. uint16_t nDeliveryOrder;
  5996. uint16_t nMaximumSDUSize;
  5997. uint16_t nDeliveryOfErroneousSDU;
  5998. uint16_t nTransferDelay;
  5999. uint16_t nTrafficHandlingPriority;
  6000. uint16_t nSDUErrorRatio;
  6001. uint16_t nResidualBER;
  6002. #endif
  6003. } CFW_GPRS_QOS;
  6004. struct CFW_SAT_CHANNEL
  6005. {
  6006. uint8_t nStatus[2];
  6007. uint16_t nBufferSize;
  6008. uint8_t nBearerType;
  6009. CFW_GPRS_QOS Qos;
  6010. uint8_t nPacketType;
  6011. };
  6012. typedef struct _CFW_EQOS
  6013. {
  6014. uint8_t nQci;
  6015. uint32_t nDlGbr;
  6016. uint32_t nUlGbr;
  6017. uint32_t nDlMbr;
  6018. uint32_t nUlMbr;
  6019. } CFW_EQOS;
  6020. typedef struct _CFW_TFT
  6021. {
  6022. uint8_t uLength;
  6023. uint8_t uTFT[255]; ///< 257 - 3 should be OK.
  6024. } CFW_TFT;
  6025. typedef struct _CFW_TFT_SET
  6026. {
  6027. uint16_t Pf_BitMap; /*Pos: 0, 1, 2, 3, ... */
  6028. uint8_t Pf_ID; /*Bit 0 - 0x8000 */
  6029. uint8_t Pf_EvaPreIdx; /*Bit 1 - 0x4000 */
  6030. uint8_t Pf_RmtAddrIPv4[8]; /*Bit 2 - 0x2000 */
  6031. uint8_t Pf_RmtAddrIPv6[32]; /*Bit 3 - 0x1000 */
  6032. uint8_t Pf_PortNum_NH; /*Bit 4 - 0x0800 */
  6033. uint16_t Pf_LocalPortRangeMin; /*Bit 5 - 0x0400 */
  6034. uint16_t Pf_LocalPortRangeMax;
  6035. uint16_t Pf_RemotPortRangeMin; /*Bit 6 - 0x0200 */
  6036. uint16_t Pf_RemotPortRangeMax;
  6037. uint32_t Pf_SPI; /*Bit 7 - 0x0100 */
  6038. uint8_t Pf_TOS_TC[2]; /*Bit 8 - 0x0080 */
  6039. uint32_t Pf_FlowLabel; /*Bit 9 - 0x0040 */
  6040. uint8_t Pf_Direct; /*Bit 10 - 0x0020 */
  6041. uint8_t Pf_LocalAddrIPv4[8]; /*Bit 11 - 0x0010 */
  6042. uint8_t Pf_LocalAddrIPv6[32]; /*Bit 12 - 0x0008 */
  6043. struct _CFW_TFT_SET *pNext;
  6044. } CFW_TFT_SET;
  6045. /* Packet Fileter component */
  6046. typedef struct _CFW_PF_CPNT
  6047. {
  6048. /* IPv4 remote address type: 8 octet (a four octet IPv4 address field and a four octet IPv4 address mask field)
  6049. IPv4 local address type: 8 octet (a four octet IPv4 address field and a four octet IPv4 address mask field)
  6050. IPv6 remote address type: 32 octet (a sixteen octet IPv6 address field and a sixteen octet IPv6 address mask field)
  6051. IPv6 remote address/prefix length type: 17 octet(a sixteen octet IPv6 address field and one octet prefix length field)
  6052. IPv6 local address/prefix length type: 17 octet(a sixteen octet IPv6 address field and one octet prefix length field)
  6053. Protocol identifier/Next header type: one octet
  6054. Single local port type: two octet
  6055. Local port range type: 4 octet (a two octet port range low limit field and a two octet port range high limit field)
  6056. Single remote port type: two octet
  6057. Remote port range type: 4 octet (a two octet port range low limit field and a two octet port range high limit field)
  6058. Security parameter index type: four octet
  6059. Type of service/Traffic class type: 2 octet (a one octet Type-of-Service/Traffic Class field and a one octet Type-of-Service/Traffic Class mask field)
  6060. Flow label type: three octet
  6061. */
  6062. uint8_t uCpntType; /* Packet filter component type identifier */
  6063. uint8_t uCpntLen; /* Packet filter component Length */
  6064. uint8_t uCpntCont[32]; /* Packet filter component Content */
  6065. struct _CFW_PF_CPNT *pNext;
  6066. } CFW_PF_CPNT;
  6067. /* One Packet Fileter */
  6068. typedef struct _CFW_TFT_PF
  6069. {
  6070. uint8_t uEBI;
  6071. uint8_t uPF_Dir; /* Packet filter direction */
  6072. uint8_t uPF_ID; /* Packet filter identifier */
  6073. uint8_t uPF_Pri; /* Packet filter evaluation precedence */
  6074. CFW_PF_CPNT *Cpnt; /* Packet filter Component */
  6075. /* Next Component */
  6076. struct _CFW_TFT_PF *pNext;
  6077. } CFW_TFT_PF;
  6078. typedef struct
  6079. {
  6080. uint8_t Ebi;
  6081. uint8_t LinkEbi;
  6082. uint8_t EbiDeact[7];
  6083. uint8_t EbiDeactNum;
  6084. uint8_t TftOpCode;
  6085. CFW_TFT_PF *pTftPf;
  6086. } CFW_TFT_PARSE;
  6087. typedef struct CFW_DATA_ATTRIBUTE_Tag
  6088. {
  6089. uint8_t rai;
  6090. uint8_t exception_data;
  6091. #define CFW_PSDATAOFF_EXEMPTED_SERVICE_TYPE_NORMAL 0x00
  6092. #define CFW_PSDATAOFF_EXEMPTED_SERVICE_TYPE_DM 0x01
  6093. #define CFW_PSDATAOFF_EXEMPTED_SERVICE_TYPE_BIP 0x02
  6094. #define CFW_PSDATAOFF_EXEMPTED_SERVICE_TYPE_RESERVED 0x04
  6095. uint16_t exempted_service_type;
  6096. } CFW_DATA_ATTRIBUTE_T;
  6097. typedef struct _CFW_GPRS_DATA
  6098. {
  6099. uint16_t nDataLength;
  6100. #if (defined LTE_NBIOT_SUPPORT) || (defined LTE_SUPPORT)
  6101. CFW_DATA_ATTRIBUTE_T attribute;
  6102. #endif
  6103. uint8_t padding;
  6104. uint8_t pData[1];
  6105. } CFW_GPRS_DATA;
  6106. //synchronization function
  6107. // AT+CGDCONT
  6108. uint32_t CFW_GprsSetPdpCxt(
  6109. uint8_t nCid,
  6110. CFW_GPRS_PDPCONT_INFO *pPdpCont,
  6111. CFW_SIM_ID nSimID); ///< [in]nCid, [in]pPdpCont
  6112. uint32_t CFW_GprsGetPdpCxt(
  6113. uint8_t nCid,
  6114. CFW_GPRS_PDPCONT_INFO *pPdpCont,
  6115. CFW_SIM_ID nSimID); ///< [in]nCid, [out]pPdpCont
  6116. uint32_t CFW_GprsSetPdpCxtV2(
  6117. uint8_t nCid,
  6118. const CFW_GPRS_PDPCONT_INFO_V2 *pPdpCont,
  6119. CFW_SIM_ID nSimID); ///< [in]nCid, [in]pPdpCont
  6120. uint32_t CFW_GprsGetPdpCxtV2(
  6121. uint8_t nCid,
  6122. CFW_GPRS_PDPCONT_INFO_V2 *pPdpCont,
  6123. CFW_SIM_ID nSimID); ///< [in]nCid, [out]pPdpCont
  6124. void CFW_GprsSetDefaultPdnMode(uint32_t mode, CFW_SIM_ID nSimID);
  6125. uint32_t CFW_GprsGetDefaultPdnMode(CFW_SIM_ID nSimID);
  6126. uint32_t CFW_GprsSetDynamicAPN(uint8_t nCid, const CFW_GPRS_DYNAMIC_APN_INFO *pDyncApn, CFW_SIM_ID nSimID);
  6127. uint32_t CFW_GprsRemovePdpCxt(
  6128. uint8_t nCid,
  6129. CFW_SIM_ID nSimID);
  6130. uint8_t CFW_GprsGetDefaultPdnInfo(CFW_GPRS_PDPCONT_DFTPDN_INFO *PdnInfo, CFW_SIM_ID nSimID);
  6131. uint32_t CFW_GprsSendCtxCfg_V2(CFW_GPRS_DFTPDN_INFO *pDftPdn, CFW_SIM_ID nSimID);
  6132. uint32_t CFW_GprsGetDynamicAPN(uint8_t nCid, CFW_GPRS_DYNAMIC_APN_INFO *pDyncApn, CFW_SIM_ID nSimID);
  6133. uint32_t CFW_GprsGetDynamicIP(uint8_t nCid, CFW_GPRS_DYNAMIC_IP_INFO *pDyncIP, CFW_SIM_ID nSimID);
  6134. typedef enum
  6135. {
  6136. PDP_CTX_TYPE_XCAP,
  6137. PDP_CTX_TYPE_IMS,
  6138. PDP_CTX_TYPE_IA,
  6139. PDP_CTX_TYPE_NUM,
  6140. PDP_CTX_TYPE_INVALID = 0xFFFFFFFF
  6141. } CFW_INTERNAL_PDP_CTX_TYPE;
  6142. typedef struct
  6143. {
  6144. uint8_t nFlag;
  6145. CFW_GPRS_PDPCONT_INFO_V2 PdpCtx;
  6146. } CFW_INTERNAL_PDP_CTX;
  6147. uint32_t CFW_GprsSetInternalPdpCtx(
  6148. CFW_INTERNAL_PDP_CTX_TYPE nType,
  6149. const CFW_GPRS_PDPCONT_INFO_V2 *pPdpCont,
  6150. CFW_SIM_ID nSimID);
  6151. CFW_GPRS_PDPCONT_INFO_V2 *CFW_GprsGetInternalPdpCtx(
  6152. CFW_INTERNAL_PDP_CTX_TYPE nType,
  6153. CFW_SIM_ID nSimID);
  6154. // AT+CGQMIN
  6155. // This command allows the TE to specify a Min Quality of Service Profile
  6156. // that is used when the MT sends an Activate PDP Context Request message
  6157. // to the network.
  6158. uint32_t CFW_GprsSetMinQos(uint8_t nCid, CFW_GPRS_QOS *pQos, CFW_SIM_ID nSimID);
  6159. uint32_t CFW_GprsGetMInQos(uint8_t nCid, CFW_GPRS_QOS *pQos, CFW_SIM_ID nSimID);
  6160. // AT+CGQREQ
  6161. // This command allows the TE to specify a Quality of Service Profile
  6162. // that is used when the MT sends an Activate PDP Context Request message
  6163. // to the network.
  6164. uint32_t CFW_GprsSetReqQos(
  6165. uint8_t nCid,
  6166. CFW_GPRS_QOS *pQos,
  6167. CFW_SIM_ID nSimID); ///< [in]nCid, [in]pQos
  6168. uint32_t CFW_GprsGetReqQos(
  6169. uint8_t nCid,
  6170. CFW_GPRS_QOS *pQos,
  6171. CFW_SIM_ID nSimID); ///< [in]nCid, [out]pQos
  6172. // AT+CGEQMIN
  6173. //This command allows the TE to specify a minimum acceptable profile, which is
  6174. //checked by the MT against the negotiated profile returned in the PDP context
  6175. //establishment and PDP contect modification procedures.
  6176. uint32_t CFW_GprsSetReqQosUmts(
  6177. uint8_t nCid,
  6178. CFW_GPRS_QOS *pQos,
  6179. CFW_SIM_ID nSimID); // [in]nCid, [in]pQos
  6180. uint32_t CFW_GprsGetReqQosUmts(
  6181. uint8_t nCid,
  6182. CFW_GPRS_QOS *pQos,
  6183. CFW_SIM_ID nSimID); // [in]nCid, [out]pQos
  6184. //AT+CGPADDR
  6185. //get the address of the selected Pdp context of the gprs network
  6186. //[in]nCid: [1-7]
  6187. // Specify the PDP Context Identifier (a numeric) which specifies a particular PDP context definition.
  6188. //[in/out]nLength: [in] nLength should be the length that malloc the pdpAdd.
  6189. // [out] nLength should be the length of the Pdp address.
  6190. //[out]pPdpAdd: Point to the buffer to hold the PDP address.
  6191. // return: If the function succeeds, the return value is ERR_SUCCESS,
  6192. // if the function fails, the following error code may be returned.
  6193. // ERR_CFW_INVALID_PARAMETER, ERR_CME_UNKNOWN,
  6194. uint32_t CFW_GprsGetPdpAddr(
  6195. uint8_t nCid,
  6196. uint8_t *nLength,
  6197. uint8_t pPdpAdd[THE_PDP_ADDR_MAX_LEN],
  6198. CFW_SIM_ID nSimID);
  6199. // using net parameter
  6200. //AT+CGREG
  6201. // get the status of the gprs network.
  6202. // [out]pStatus: Pointer to CFW_NW_STATUS_INFO structure to contain the network status information
  6203. // return: If the function succeeds, the return value is ERR_SUCCESS,
  6204. // if the function fails, the following error code may be returned.
  6205. // ERR_CFW_INVALID_PARAMETER, ERR_CME_UNKNOWN,
  6206. uint32_t CFW_GprsGetstatus(
  6207. CFW_NW_STATUS_INFO *pStatus,
  6208. CFW_SIM_ID nSimID); //
  6209. uint8_t CFW_GprsGetPsType(uint8_t nSimID);
  6210. /*! \brief retrieves the state of the GPRS service
  6211. \param [out] pState Point to uint8_t to hold the state of GPRS attachment.
  6212. - \a CFW_GPRS_DEACTIVED (0)
  6213. - \a CFW_GPRS_ACTIVED (1)
  6214. \param [in] nSimID SIM ID
  6215. \return \a ERR_SUCCESS on success, or error code
  6216. */
  6217. uint32_t CFW_GetGprsAttState(
  6218. uint8_t *pState,
  6219. CFW_SIM_ID nSimID);
  6220. /*! \brief retrieves the state of the GPRS Service according to the selected cid
  6221. \param [in] nCid Specify the PDP Context Identifier (a numeric) which specifies
  6222. a particular PDP context definition.
  6223. \param [out] pState Point to uint8_t to hold the state of GPRS activation.
  6224. - \a CFW_GPRS_DEACTIVED (0)
  6225. - \a CFW_GPRS_ACTIVED (1)
  6226. \param [in] nSimID SIM ID
  6227. \return \a ERR_SUCCESS on success, or error code
  6228. */
  6229. uint32_t CFW_GetGprsActState(
  6230. uint8_t nCid,
  6231. uint8_t *pState,
  6232. CFW_SIM_ID nSimID);
  6233. /*! \brief activate or deactivate the specified PDP context.
  6234. The result should be returned through the following \a EV_CFW_GPRS_ACT_RSP event:
  6235. \rst
  6236. +------+--------------------+------------+---------+-------------+
  6237. | UTI | nType | nParam1 | nParam2 | Description |
  6238. +======+====================+============+=========+=============+
  6239. | nUTI | CFW_GPRS_DEACTIVED | 0 | 0 | OK |
  6240. | | CFW_GPRS_ACTIVED | | | |
  6241. +------+--------------------+------------+---------+-------------+
  6242. | nUTI | 0xF0/0xF1 | Error code | nCid | Error |
  6243. +------+--------------------+------------+---------+-------------+
  6244. \endrst
  6245. \param [in] nState Specify the state of PDP context activation
  6246. - \a CFW_GPRS_DEACTIVED (0)
  6247. - \a CFW_GPRS_ACTIVED (1)
  6248. \param [in] nCid Specify the PDP Context Identifier (a numeric) which specifies
  6249. a particular PDP context definition.
  6250. \param [in] nUTI UTI operation
  6251. \param [in] nSimID SIM ID
  6252. \return \a ERR_SUCCESS on success, or error code
  6253. */
  6254. uint32_t CFW_GprsAct(uint8_t nState, uint8_t nCid, uint16_t nUTI, CFW_SIM_ID nSimID);
  6255. uint32_t CFW_GprsActEx(
  6256. uint8_t nState,
  6257. uint8_t nCid,
  6258. uint16_t nUTI,
  6259. CFW_SIM_ID nSimID,
  6260. bool SavedInApp); ///< [in] nCid // notify: success or fail
  6261. uint32_t CFW_AttDetach(
  6262. uint8_t nState,
  6263. uint16_t nUTI,
  6264. uint8_t AttDetachType,
  6265. CFW_SIM_ID nSimID);
  6266. void CFW_SetPsDataAttribute(CFW_DATA_ATTRIBUTE_T *pAttribute, uint8_t rai, uint8_t exception_data, uint16_t exempted_service_type);
  6267. uint32_t CFW_SetDnsServerbyPdp(uint8_t nCid, uint8_t nSimID, uint8_t Pro_DnsIp[4], uint8_t Sec_DnsIp[4]);
  6268. uint32_t CFW_SetDnsServerbyPdpV2(uint8_t nCid, uint8_t nSimID, uint8_t Pro_DnsIp[16], uint8_t Sec_DnsIp[16]);
  6269. uint32_t CFW_getDnsServerbyPdp(uint8_t nCid, uint8_t nSimID);
  6270. uint32_t *getDNSServer(uint8_t nCid, uint8_t nSimID);
  6271. uint8_t CFW_ImsGetCevdp(uint8_t nSimID);
  6272. #ifdef DEDICATED_BEARER_SUPPORT
  6273. uint32_t CFW_GprsSecPdpAct(uint8_t nState, uint8_t nCid, uint8_t nPCid, uint16_t nUTI, CFW_SIM_ID nSimID);
  6274. #endif
  6275. uint32_t CFW_GprsSetPsm(uint8_t psmEnable, uint8_t bitmap, uint8_t t3324, uint8_t t3412, uint8_t nSimID);
  6276. uint32_t CFW_GprsSetCtxTFT(uint8_t nCid, CFW_TFT_SET *pTft, uint8_t nSimID);
  6277. uint32_t CFW_GprsSetCtxEQos(uint8_t nCid, CFW_EQOS *pQos, uint8_t nSimID);
  6278. uint32_t CFW_GprsGetCtxEQos(uint8_t nCid, CFW_EQOS *pQos, CFW_SIM_ID nSimID);
  6279. uint32_t CFW_GprsCtxEpsModify(uint16_t nUTI, uint8_t nCid, CFW_SIM_ID nSimID);
  6280. uint32_t CFW_GprsGetNetEQos(uint8_t nCid, CFW_EQOS *pQos, CFW_SIM_ID nSimID);
  6281. /*! \Manual acceptance of a network request for PDP context activation 'A'
  6282. The result should be returned through the \a EV_CFW_GPRS_CXT_ACTIVE_IND_NOTIFY event:
  6283. \rst
  6284. +------+-----------+------------+---------+-------------+
  6285. | UTI | nType | nParam1 | nParam2 | Description |
  6286. +======+===========+============+=========+=============+
  6287. | nUTI | 0 | 0 | 0 | OK |
  6288. +------+-----------+------------+---------+-------------+
  6289. | nUTI | 0xF0/0xF1 | Error code | 0 | Error |
  6290. +------+-----------+------------+---------+-------------+
  6291. \endrst
  6292. \param [in] nUTI Specify the UTI (Unique Transaction Identifier) operation, which support multi-application in parallel. This parameter will
  6293. be return in notification event (see below). You also can get a free UTI by CFW_GetFreeUTI function if you application is a dynamical
  6294. module. This parameter should be less than 255 for all upper layer application.
  6295. \param [in] nCid Specify the PDP Context Identifier (a numeric) which specifies a particular PDP context definition.
  6296. \param [in] nSimID SIM ID
  6297. \return \a ERR_SUCCESS on success, or error code
  6298. */
  6299. uint32_t CFW_GprsManualAcc(
  6300. uint16_t nUTI,
  6301. uint8_t nCid,
  6302. CFW_SIM_ID nSimID);
  6303. /*! \Manual rejection of a network request for PDP context activation 'H'
  6304. The function is used to reject the request of a network for GPRS PDP context activation
  6305. which has been signaled to the TE by the RING or CRING unsolicited result code.
  6306. \param [in] nUTI UTI operation
  6307. \param [in] nCid a numeric parameter which specifies a particular PDP context definition
  6308. \param [in] nSimID SIM ID
  6309. \return \a ERR_SUCCESS on success, or error code
  6310. */
  6311. uint32_t CFW_GprsManualRej(
  6312. uint16_t nUTI,
  6313. uint8_t nCid,
  6314. CFW_SIM_ID nSimID);
  6315. /*! \The function is used to modify the specified PDP context with QoS
  6316. parameter. After this function has completed, the MT returns to V.25ter online data
  6317. state. If the requested modification for any specified context cannot be
  6318. achieved, an event with ERROR information is returned.
  6319. \param [in] nCid a numeric parameter which specifies a particular PDP context definition
  6320. \param [in] nUTI UTI operation
  6321. \param [in] QOS Point to CFW_GPRS_QOS structure to set the Quality of Service
  6322. \param [in] nSimID SIM ID
  6323. \return \a ERR_SUCCESS on success, or error code
  6324. */
  6325. uint32_t CFW_GprsCtxModify(
  6326. uint16_t nUTI,
  6327. uint8_t nCid,
  6328. CFW_GPRS_QOS *Qos,
  6329. CFW_SIM_ID nSimID);
  6330. /*! \This message is sent by MMI to accept the PDP context modification requested by
  6331. the network in an api_PdpCtxModifyInd message.
  6332. \param [in] nUTI UTI operation
  6333. \param [in] nCid a numeric parameter which specifies a particular PDP context definition
  6334. \param [in] nSimID SIM ID
  6335. \return \a ERR_SUCCESS on success, or error code
  6336. */
  6337. uint32_t CFW_GprsCtxModifyAcc(
  6338. uint16_t nUTI,
  6339. uint8_t nCid,
  6340. CFW_SIM_ID nSimID);
  6341. // return: If the function succeeds, the return value is ERR_SUCCESS,
  6342. // if the function fails, the following error code may be returned.
  6343. // ERR_CFW_INVALID_PARAMETER, ERR_CME_UNKNOWN,
  6344. // event: NO
  6345. uint32_t CFW_GprsCtxModifyRej(
  6346. uint16_t nUTI,
  6347. uint8_t nCid,
  6348. CFW_SIM_ID nSimID);
  6349. /*! \The function is used to send PDP data to the network. The implementation
  6350. of this function is always called by upper protocol
  6351. \param [in] nCid a numeric parameter which specifies a particular PDP context definition
  6352. \param [in] pGprsData point to the data that need to send
  6353. \param [in] rai the value of the release assistance indication, refer 3GPP TS 24.301 [83] subclause 9.9.4.25.
  6354. \param [in] nSimID SIM ID
  6355. \return \a ERR_SUCCESS on success, or error code
  6356. */
  6357. uint32_t CFW_GprsSendData(
  6358. uint8_t nCid,
  6359. CFW_GPRS_DATA *pGprsData,
  6360. uint8_t rai,
  6361. CFW_SIM_ID nSimID);
  6362. /*! \The function is used to send PDP data length to the network.
  6363. \param [in] nSimID SIM ID
  6364. \param [in] nCid a numeric parameter which specifies a particular PDP context definition
  6365. \param [in] nDataLen the value of PDP data length to the network
  6366. \return \a ERR_SUCCESS on success, or error code
  6367. */
  6368. uint32_t CFW_GprsSendDataV2(uint8_t nSim, uint8_t nCid, uint16_t nDataLen);
  6369. uint32_t CFW_PsSendData(
  6370. uint8_t nCid,
  6371. uint32_t pDataOffset,
  6372. CFW_SIM_ID nSimID);
  6373. /*! \brief attach or dettach from GPRS service
  6374. The result should be returned through the \a EV_CFW_GPRS_ATT_RSP event:
  6375. \rst
  6376. +------+-------------------+------------+---------+-------------+
  6377. | UTI | nType | nParam1 | nParam2 | Description |
  6378. +======+===================+============+=========+=============+
  6379. | nUTI | CFW_GPRS_ATTACHED | 0 | 0 | OK |
  6380. | | CFW_GPRS_DETACHED | | | |
  6381. +------+-------------------+------------+---------+-------------+
  6382. | nUTI | 0xF0/0xF1 | Error code | 0 | Error |
  6383. +------+-------------------+------------+---------+-------------+
  6384. \endrst
  6385. \param [in] nState Specify the state of GPRS attachment. It can be
  6386. - \a CFW_GPRS_DETACHED (0) dettach
  6387. - \a CFW_GPRS_ATTACHED (1) attach
  6388. \param [in] nUTI UTI operation
  6389. \param [in] nSimID SIM ID
  6390. \return \a ERR_SUCCESS on success, or error code
  6391. */
  6392. uint32_t CFW_GprsAtt(uint8_t nState, uint16_t nUTI, CFW_SIM_ID nSimID);
  6393. uint32_t CFW_GetGprsSum(int32_t *upsum, int32_t *downsum, CFW_SIM_ID nSimID);
  6394. uint32_t CFW_ClearGprsSum(CFW_SIM_ID nSimID);
  6395. uint32_t CFW_ImsSsUtAddrSet(uint8_t nCid, uint8_t nSize, uint8_t *paddr, CFW_SIM_ID nSimID);
  6396. uint8_t CFW_GprsSetSmsSeviceMode(uint8_t nService);
  6397. uint8_t CFW_GprsGetSmsSeviceMode(void);
  6398. /*! \The function is used to check the sim card is test card or normal card.
  6399. \param [in] nSimID SIM ID
  6400. \return \a 0 for normal card, or 1 for test card.
  6401. */
  6402. uint32_t CFW_CheckTestSim(CFW_SIM_ID nSimID);
  6403. #endif
  6404. //
  6405. //Tcpip
  6406. //
  6407. //add for DNS
  6408. typedef enum e_resolv_result
  6409. {
  6410. RESOLV_QUERY_INVALID,
  6411. RESOLV_QUERY_QUEUED,
  6412. RESOLV_COMPLETE,
  6413. RESOLV_ENUM_FILL = 0x7fffffff
  6414. } RESOLV_RESULT;
  6415. #define RESOLV_NETWORK_ERROR 0x01
  6416. #define RESOLV_HOST_NO_FOUND 0x02
  6417. // Shell
  6418. //
  6419. uint32_t CFW_MeChangePassword(
  6420. uint16_t nFac,
  6421. uint8_t *pBufPwd,
  6422. uint8_t nPwdSize,
  6423. uint8_t nMode,
  6424. uint16_t nUTI);
  6425. uint32_t CFW_MeGetFacilityLock(
  6426. uint16_t nFac,
  6427. uint16_t nUTI);
  6428. uint32_t CFW_MeSetFacilityLock(
  6429. uint16_t nFac,
  6430. uint8_t *pBufPwd,
  6431. uint8_t nPwdSize,
  6432. uint8_t nMode,
  6433. uint16_t nUTI);
  6434. #ifdef CFW_GPRS_SUPPORT
  6435. //Errors related to a failure to perform an Attach
  6436. #define ERR_CFW_GPRS_ILLEGAL_MS 103 ///< Illegal MS (#3)
  6437. #define ERR_CFW_GPRS_ILLEGAL_ME 106 ///< Illegal ME (#6)
  6438. #define ERR_CFW_GPRS_GPRS_SERVICES_NOT_ALLOWED 107 ///< GPRS services not allowed (#7)
  6439. #define ERR_CFW_GPRS_PLMN_NOT_ALLOWED 111 ///< PLMN not allowed (#11)
  6440. #define ERR_CFW_GPRS_LOCATION_AREA_NOT_ALLOWED 112 ///< Location area not allowed (#12)
  6441. #define ERR_CFW_GPRS_ROAMING_NOT_ALLOWED_IN_THIS_LOCATION_AREA 113 ///< Roaming not allowed in this location area (#13)
  6442. //Errors related to a failure to Activate a Context
  6443. #define ERR_CFW_GPRS_SERVICE_OPTION_NOT_SUPPORTED 132 ///< service option not supported (#32)
  6444. #define ERR_CFW_GPRS_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED 133 ///< requested service option not subscribed (#33)
  6445. #define ERR_CFW_GPRS_SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER 134 ///< service option temporarily out of order (#34)
  6446. #define ERR_CFW_GPRS_PDP_AUTHENTICATION_FAILURE 149 ///< PDP authentication failure
  6447. #define ERR_CFW_GPRS_UNSPECIFIED 148 ///< unspecified GPRS error
  6448. #endif
  6449. //
  6450. // Some functions need be supported by OS Kernerl(KL) based on the current target platform(MIPS).
  6451. //
  6452. typedef uint32_t (*PFN_KL_SENDMESSAGDE2APP)(uint32_t nEventId, void *pData, uint32_t nSize);
  6453. typedef uint32_t (*PFN_KL_SENDMESSAGDE_EX)(uint32_t nMailBox, uint32_t nEventId, void *pData, uint32_t nSize);
  6454. typedef void *(*PFN_KL_MALLOC)(uint32_t nSize);
  6455. typedef bool (*PFN_KL_FREE)(void *nAddr);
  6456. typedef bool (*PFN_KL_IS_VALIDHEAP)(void *pData, uint32_t nSize);
  6457. typedef bool (*PFN_AUD_START_SPK_MIC)(void);
  6458. typedef bool (*PFN_AUD_STOP_SPK_MIC)(void);
  6459. typedef struct _CFW_PFN_AUD_CBS
  6460. {
  6461. PFN_AUD_START_SPK_MIC m_pfnAudStartSpkMic;
  6462. PFN_AUD_STOP_SPK_MIC m_pfnAudStopSpkMic;
  6463. } CFW_PFN_AUD_CBS;
  6464. typedef struct _CFW_PFN_KL_CBS
  6465. {
  6466. PFN_KL_SENDMESSAGDE2APP m_pfnKlSendMsg2App;
  6467. PFN_KL_SENDMESSAGDE_EX m_pfnKlSendMsgEx;
  6468. PFN_KL_MALLOC m_pfnKlMalloc;
  6469. PFN_KL_FREE m_pfnKlFree;
  6470. PFN_KL_IS_VALIDHEAP m_pfnKlIsValidHeap;
  6471. } CFW_PFN_KL_CBS;
  6472. //
  6473. //add by lixp
  6474. //
  6475. typedef struct _CFW_SAT_MENU_RSP_LIST
  6476. {
  6477. uint8_t nComID;
  6478. uint8_t nComQualifier;
  6479. uint16_t nAlphaLen;
  6480. uint8_t *pAlphaStr;
  6481. CFW_SAT_ITEM_LIST *pItemList; ///< Link list
  6482. } CFW_SAT_MENU_RSP_LIST, CFW_SAT_MENU_RSP;
  6483. #define CFW_PBK_HINT_MAX_SIZE 16
  6484. typedef struct _CFW_SMS_OUT_PARAM
  6485. {
  6486. uint8_t nType;
  6487. uint8_t padding[3];
  6488. uint32_t nParam1;
  6489. uint32_t nParam2;
  6490. } CFW_SMS_OUT_PARAM;
  6491. // CFW Init status phase.
  6492. #define CFW_INIT_STATUS_NO_SIM (0x01)
  6493. #define CFW_INIT_STATUS_SIM (0x02)
  6494. #define CFW_INIT_STATUS_SAT (0x04)
  6495. #define CFW_INIT_STATUS_SIMCARD (0x08)
  6496. #define CFW_INIT_STATUS_SMS (0x10)
  6497. #define CFW_INIT_STATUS_PBK (0x20)
  6498. #define CFW_INIT_STATUS_NET (0x40)
  6499. #define CFW_INIT_STATUS_AUTODAIL (0x80)
  6500. #define CFW_INIT_STATUS_NO_MEMORY (0x81)
  6501. #define CFW_INIT_STATUS_SIM_DROP (0x82)
  6502. #define CFW_INIT_STATUS_SIM_COMPLTED (0xF0)
  6503. //
  6504. // CFW Init status
  6505. //
  6506. #define CFW_INIT_SIM_CARD_BLOCK 0x4
  6507. #define CFW_INIT_SIM_WAIT_PIN1 0x8
  6508. #define CFW_INIT_SIM_WAIT_PUK1 0x10
  6509. #define CFW_INIT_SIM_PIN1_READY 0x20
  6510. #define CFW_INIT_SIM_WAIT_PS 0x40
  6511. #define CFW_INIT_SIM_WAIT_PF 0x80
  6512. #define CFW_INIT_SIM_CARD_BAD 0x100
  6513. #define CFW_INIT_SIM_CARD_ABNORMITY 0x200
  6514. #define CFW_INIT_SIM_TEST_CARD 0x400
  6515. #define CFW_INIT_SIM_NORMAL_CARD 0x800
  6516. #define CFW_INIT_SIM_CARD_CHANGED 0x1000
  6517. #define CFW_INIT_SIM_SAT 0x2000
  6518. //
  6519. // CFW Exit status
  6520. //
  6521. #define CFW_EXIT_STATUS_NETWORK_DETACHMENT (0x01)
  6522. #define CFW_EXIT_STATUS_SIM_POWER_OFF (0x02)
  6523. #define CFW_EXIT_STATUS_CFW_EXIT (0x10)
  6524. /************************************************ENGINERRING TEST MODE**************************************************/
  6525. //
  6526. //add for emod at 20060819
  6527. //
  6528. typedef struct _CFW_EMOD_BATTERY_CHARGE_INFO
  6529. {
  6530. uint8_t nBcs; ///< Point to the unsigned 8-bit variable to retrieve the connection status of battery pack.
  6531. //This parameter can be one of the following:
  6532. //0 No charging adapter is connected
  6533. //1 Charging adapter is connected
  6534. //2 Charging adapter is connected, charging in progress
  6535. //3 Charging adapter is connected, charging has finished
  6536. //4 Charging error, charging is interrupted
  6537. //5 False charging temperature, charging is interrupted while temperature is beyond allowed range
  6538. uint8_t nBcl; //Point to the unsigned 8-bit variable to retrieve the battery level. This parameter can be
  6539. //one of the following:
  6540. //0 battery is exhausted, or does not have a battery connected
  6541. // 20, 40, 60, 80, 100 percent of remaining capacity.
  6542. //The percent is not accurate ,but a estimated expression.
  6543. uint16_t nMpc; //Point to the unsigned 16-bit variable to retrieve the average power consumption.
  6544. //This parameter can be one of the following value:
  6545. //0-5000 Value (0...5000) of average power consumption (mean value over a couple of seconds) in mA.
  6546. } CFW_EMOD_BATTERY_CHARGE_INFO;
  6547. typedef struct _CFW_EMOD_BATTERY_INFO
  6548. {
  6549. PM_BATTERY_INFO nBatState;
  6550. CFW_EMOD_BATTERY_CHARGE_INFO nChargeInfo;
  6551. uint8_t nChemistry; //
  6552. } CFW_EMOD_BATTERY_INFO;
  6553. bool CFW_EmodGetBatteryInfo(CFW_EMOD_BATTERY_INFO *pBatInfo);
  6554. void CFW_EmodAudioTestStart(uint8_t type); //type value: 0 is normal; 1 is mic AUX and speak AUX; 2 is mic loud and speak loud.
  6555. void CFW_EmodAudioTestEnd(void);
  6556. bool CFW_EmodClearUserInfo(void); //return TRUE is success,and FALSE is failure.
  6557. void CFW_EmodGetIMEI(uint8_t pImei[16], uint8_t *pImeiLen, CFW_SIM_ID nSimID); //pImei is the buffer that
  6558. void CFW_EmodSaveIMEI(uint8_t *pImei, uint8_t imeiLen, CFW_SIM_ID nSimID);
  6559. uint32_t CFW_EmodSupportDisableIdLte(
  6560. uint8_t bSupport,
  6561. CFW_SIM_ID nSimId);
  6562. void CFW_EmodSetTracePort(uint8_t port);
  6563. uint8_t CFW_EmodGetTracePort(void);
  6564. void CFW_EmodSetTraceFlag(uint8_t bStop);
  6565. uint8_t CFW_EmodGetTraceFlag(void);
  6566. /************************************
  6567. Check the Gsm calibration mark bit
  6568. return: uint32_t
  6569. GSM_calib_afc --bit0
  6570. GSM850_calib_agc --bit1
  6571. GSM850_calib_apc --bit2
  6572. GSM900_calib_agc --bit3
  6573. GSM900_calib_apc --bit4
  6574. PCS_calib_agc --bit5
  6575. PCS_calib_apc --bit6
  6576. DCS_calib_agc --bit7
  6577. DCS_calib_apc --bit8
  6578. GSM_FT_flag --bit9
  6579. *************************************/
  6580. uint32_t CFW_EmodGetGsmCalibInfo(void);
  6581. /************************************
  6582. Check the Lte calibration mark bit
  6583. return: uint32_t
  6584. LTE_calib_afc --bit0
  6585. LTE_TDD_calib_agc --bit1
  6586. LTE_TDD_calib_apc --bit2
  6587. LTE_FDD_calib_agc --bit3
  6588. LTE_FDD_calib_apc --bit4
  6589. LTE_FT_flag --bit9
  6590. ************************************/
  6591. uint32_t CFW_EmodGetLteCalibInfo(void);
  6592. uint32_t CFW_EmodGetNvVersion(void);
  6593. uint8_t *CFW_EmodGetNvData(
  6594. uint8_t dataType,
  6595. uint8_t nSim);
  6596. int32_t CFW_EmodSetNvData(
  6597. uint8_t dataType,
  6598. uint16_t offset,
  6599. uint16_t dataLength,
  6600. uint8_t *data,
  6601. uint8_t nSim);
  6602. int32_t CFW_EmodSaveNvData(
  6603. uint8_t dataType,
  6604. uint8_t nSim);
  6605. int32_t CFW_EmodSpecialNvProcess(
  6606. uint8_t operType,
  6607. uint8_t dataType,
  6608. uint16_t offset,
  6609. uint16_t dataLength,
  6610. uint8_t *data,
  6611. uint8_t nSim);
  6612. uint32_t CFW_EmodEngineerCmd(
  6613. uint32_t module,
  6614. uint32_t cmd,
  6615. uint32_t v1,
  6616. uint32_t v2,
  6617. uint32_t v3);
  6618. //
  6619. //bind
  6620. //
  6621. typedef struct _CFW_EMOD_BIND_SIM
  6622. {
  6623. uint8_t nIndex;
  6624. uint8_t nImsiLen;
  6625. uint8_t pImsiNum[15];
  6626. uint8_t pad[3];
  6627. } CFW_EMOD_BIND_SIM;
  6628. typedef struct _CFW_EMOD_BIND_NW
  6629. {
  6630. uint8_t nIndex;
  6631. uint8_t pNccNum[3];
  6632. } CFW_EMOD_BIND_NW;
  6633. typedef struct _CFW_EMOD_READ_BIND_SIM
  6634. {
  6635. uint8_t nNumber;
  6636. uint32_t nPointer;
  6637. uint8_t pad[3];
  6638. } CFW_EMOD_READ_BIND_SIM;
  6639. typedef struct _CFW_EMOD_READ_BIND_NW
  6640. {
  6641. uint8_t nNumber;
  6642. uint32_t nPointer;
  6643. uint8_t pad[3];
  6644. } CFW_EMOD_READ_BIND_NW;
  6645. void CFW_EmodReadBindSIM(CFW_EMOD_READ_BIND_SIM *pReadBindSim);
  6646. void CFW_EmodReadBindNW(CFW_EMOD_READ_BIND_NW *pReadBindNw);
  6647. void CFW_EmodGetBindInfo(bool *bSim, bool *bNetWork); //ture: had been bond.false:not bind
  6648. uint32_t CFW_EmodSetBindInfo(bool bSim, bool bNetWork);
  6649. typedef struct _CFW_EMOD_UPDATE_RETURN
  6650. {
  6651. uint32_t nErrCode;
  6652. uint8_t nIndex;
  6653. } CFW_EMOD_UPDATE_RETURN;
  6654. CFW_EMOD_UPDATE_RETURN CFW_EmodUpdateSimBind(
  6655. uint8_t nIndex,
  6656. uint8_t *pBindSimNum,
  6657. uint8_t nLen);
  6658. CFW_EMOD_UPDATE_RETURN CFW_EmodUpdateNwBind(
  6659. uint8_t nIndex,
  6660. uint8_t *pBindNwNum,
  6661. uint8_t nLen);
  6662. /**
  6663. * byte pool information
  6664. */
  6665. typedef struct
  6666. {
  6667. uint32_t avail_size; ///< available size. The actual allocatable size may be less than this
  6668. } CFW_BytePoolInfo_t;
  6669. /**
  6670. * block pool information
  6671. */
  6672. typedef struct
  6673. {
  6674. uint32_t avail_blocks; ///< available blocks.
  6675. uint32_t block_size;
  6676. } CFW_BlockPoolInfo_t;
  6677. #define CFW_BLOCK_MEM_NUM 10
  6678. typedef struct
  6679. {
  6680. CFW_BytePoolInfo_t ByteMemInfo;
  6681. uint8_t nBlocks;
  6682. CFW_BlockPoolInfo_t BlockMeminfo[CFW_BLOCK_MEM_NUM];
  6683. } CFW_AllMemInfo_t;
  6684. uint32_t CFW_EmodGetAllMemoryInfo(CFW_AllMemInfo_t *pMemInfo);
  6685. //SN number
  6686. typedef struct _CFW_EMOD_LOCT_PRODUCT_INFO
  6687. {
  6688. uint8_t nBoardSNLen;
  6689. uint8_t nBoardSN[64];
  6690. uint8_t nPhoneSNLen;
  6691. uint8_t nPhoneSN[64];
  6692. } CFW_EMOD_LOCT_PRODUCT_INFO;
  6693. typedef struct _CFW_EMOD_RF_CALIB_INFO
  6694. {
  6695. uint16_t nLowDacLimit[6];
  6696. uint16_t nLowVoltLimit[6];
  6697. uint32_t nName;
  6698. int16_t nPcl2dbmArfcn_d[30];
  6699. int16_t nPcl2dbmArfcn_g[30];
  6700. int16_t nPcl2dbmArfcn_p[30];
  6701. int16_t nProfiledBmMax_dp;
  6702. int16_t nProfiledBmMax_g;
  6703. int16_t nProfiledBmMin_dp;
  6704. int16_t nProfiledBmMin_g;
  6705. // uint16_t nProfile_dp[1024];
  6706. // uint16_t nProfile_g[1024];
  6707. uint16_t nProfileInterp_dp[16];
  6708. uint16_t nProfileInterp_g[16];
  6709. uint16_t nRampHigh[32];
  6710. uint16_t nRampLow[32];
  6711. uint16_t nRampSwap_dp;
  6712. uint16_t nRampSwap_g;
  6713. int32_t nRaram[15];
  6714. int16_t nTimes[15];
  6715. } CFW_EMOD_RF_CALIB_INFO;
  6716. void CFW_EmodGetRFCalibrationInfo(CFW_EMOD_RF_CALIB_INFO *pRfCalib);
  6717. typedef struct
  6718. {
  6719. uint8_t atFuncIndex;
  6720. uint8_t value;
  6721. uint8_t rsrp_flag;
  6722. uint8_t rsrp;
  6723. uint8_t rsrq_flag;
  6724. uint8_t rsrq;
  6725. uint8_t gsmBand;
  6726. uint8_t gsmNum;
  6727. uint16_t gsmArfcn[3];
  6728. uint8_t lteNum;
  6729. uint32_t lteArfcn[8];
  6730. } CFW_EmodSpLteDummyPara_t;
  6731. typedef struct
  6732. {
  6733. uint8_t paramIndex;
  6734. uint8_t enable;
  6735. uint16_t value1;
  6736. uint16_t value2;
  6737. } CFW_EmodRrtmParam_t;
  6738. typedef struct
  6739. {
  6740. uint32_t earfcn;
  6741. uint8_t prior;
  6742. uint8_t thresh_h;
  6743. uint8_t thresh_l;
  6744. } CFW_EmodGrrLteFreq_t;
  6745. typedef struct
  6746. {
  6747. uint8_t index;
  6748. uint8_t value;
  6749. } CFW_EmodRrdmParam_t;
  6750. typedef struct
  6751. {
  6752. uint16_t index;
  6753. uint16_t value;
  6754. } CFW_EmodL1Param_t;
  6755. typedef struct
  6756. {
  6757. uint8_t type;
  6758. } CFW_EmodSpCleanInfo_t;
  6759. //
  6760. // test mode of outfield
  6761. //
  6762. #define CFW_TSM_CURRENT_CELL 0x01
  6763. #define CFW_TSM_NEIGHBOR_CELL 0x02
  6764. #define CFW_TSM_PLOT_LTE 0x03
  6765. #define CFW_TSM_END_EMOD 0x04
  6766. /*********************************************************************************************************/
  6767. typedef struct _CFW_TSM_CURR_CELL_INFO
  6768. {
  6769. uint16_t nTSM_Arfcn; //Absolute Radio Frequency Channel Number ,[0..1023].
  6770. uint8_t nTSM_Rla; // Averaged measure
  6771. uint8_t nTSM_LAI[5]; //Location Area Identification.
  6772. uint8_t nTSM_RAC; //Routing Area Code ( GPRS only), [0..255].
  6773. #if (defined LTE_NBIOT_SUPPORT) || (defined LTE_SUPPORT)
  6774. uint8_t nTSM_CellID[4]; //Cell Identity.
  6775. #else
  6776. uint8_t nTSM_CellID[2]; //Cell Identity.
  6777. #endif
  6778. uint8_t nTSM_Bsic; //Synchronisation code,[0..63].
  6779. bool nTSM_BCCHDec; //Indicates if the BCCH info has been decoded on the cell.
  6780. uint8_t nTSM_NetMode; //Network Mode of Operation (GPRS only),[0..2].
  6781. uint8_t nTSM_AvRxLevel; //Average Rx level in Abs Val of dBm ,[0..115].
  6782. uint8_t nTSM_MaxTxPWR; //Max allowed transmit power, [0..31].
  6783. int8_t nTSM_C1Value; //Cell quality ,[-33..110].
  6784. uint8_t nTSM_BER; //Bit Error Rate [0..255],255 = non significant.
  6785. uint8_t nTSM_TimeADV; //Timing Advance (valid in GSM connected mode only).[0..255] 255 = non significant.
  6786. uint8_t nTSM_CCCHconf; //ccch configuration
  6787. //0:CCCH_1_CHANNEL_WITH_SDCCH meanning 1 basic physical channel used for CCCH, combined with SDCCH
  6788. //1:CCCH_1_CHANNEL meanning 1 basic physical channel used for CCCH, not combined with SDCCH
  6789. //2:CCCH_2_CHANNEL meanning 2 basic physical channel used for CCCH, not combined with SDCCH
  6790. //3:CCCH_3_CHANNEL meanning 3 basic physical channel used for CCCH, not combined with SDCCH
  6791. //4:CCCH_4_CHANNEL meanning 4 basic physical channel used for CCCH, not combined with SDCCH
  6792. //0xFF:INVALID_CCCH_CHANNEL_NUM meanning Invalid value
  6793. uint8_t nTSM_BsPaMfrms; // BS-PA-MFRMS
  6794. uint8_t nTSM_RxQualFull; //receive quality full [0~7]
  6795. uint8_t nTSM_RxQualSub; //receive quality sub [0~7]
  6796. int16_t nTSM_C2; //Value of the cell reselection criterium [-96~173]
  6797. uint8_t nTSM_CurrBand; //current band used,possible value see below
  6798. uint8_t nTSM_CurrChanType; //Current channel type
  6799. //0:CHANNEL_TYPE_SDCCH meanning Current channel type is SDCCH
  6800. //1:CHANNEL_TYPE_TCH_H0 meanning Current channel type is TCH ,half rate,Subchannel 0
  6801. //2:CHANNEL_TYPE_TCH_H1 meanning Current channel type is TCH ,half rate,Subchannel 1
  6802. //3:CHANNEL_TYPE_TCH_F meanningCurrent channel type is TCH ,full rate
  6803. //0xff:INVALID_CHANNEL_TYPE meanning Invalid channel type
  6804. uint32_t nTSM_CurrChanMode; //current channel mode ,only valid in decicated mode
  6805. //API_SIG_ONLY 1<<0 signalling only
  6806. //API_SPEECH_V1 1<<1 speech full rate or half rate version 1
  6807. //API_SPEECH_V2 1<<2 speech full rate or half rate version 2
  6808. //API_SPEECH_V3 1<<3 speech full rate or half rate version 3
  6809. //API_43_14_KBS 1<<4 data, 43.5kbit/s dwnlnk, 14.5kbit/s uplnk
  6810. //API_29_14_KBS 1<<5 data, 29.0kbit/s dwnlnk, 14.5kbit/s uplnk
  6811. //API_43_29_KBS 1<<6 data, 43.5kbit/s dwnlnk, 29.0kbit/s uplnk
  6812. //API_14_43_KBS 1<<7 data, 14.5kbit/s dwnlnk, 43.5kbit/s uplnk
  6813. //API_14_29_KBS 1<<8 data, 14.5kbit/s dwnlnk, 29.0kbit/s uplnk
  6814. //API_29_43_KBS 1<<9 data, 29.0kbit/s dwnlnk, 43.5kbit/s uplnk
  6815. //API_43_KBS 1<<10 data, 43.5kbit/s
  6816. //API_32_KBS 1<<11 data, 32.0kbit/s
  6817. //API_29_KBS 1<<12 data, 29.0kbit/s
  6818. //API_14_KBS 1<<13 data, 14.5kbit/s
  6819. //API_12_KBS 1<<14 data, 12.0kbit/s
  6820. //API_6_KBS 1<<15 data, 6.0kbit/s
  6821. //API_3_KBS 1<<16 data, 3.6kbit/s
  6822. //API_INVALID_CHAN_MODE 0xFFFFFFFF Invalid channel mode
  6823. //9:BAND_GSM900 meanning Band GSM900P, GSM900E and GSM900R
  6824. //18:BAND_DCS1800 meanning Band DCS1800
  6825. //19:BAND_PCS1900 meanning Band PCS 1900
  6826. //0xFF:BAND_INVALID meanning Invalid band value
  6827. uint8_t nTSM_MaxRetrans; //max number of random access retransmission 1,2,4,7
  6828. uint8_t nTSM_BsAgBlkRes; //block number kept for AGCH in common channel [0~7]
  6829. uint8_t nTSM_AC[2]; //Access Class [0~255]
  6830. uint8_t nTSM_RxLevAccMin; //receive level access minimum [0~63]
  6831. bool bTSM_EC; //Indicates if emergency call has been allowed
  6832. bool bTSM_SI7_8; //Indicates if SI7 and 8 are broadcast
  6833. bool bTSM_ATT; //Indicates if IMSI attach has been allowed
  6834. uint8_t nTSM_RxDbm; //indicates current rx power
  6835. uint8_t nTSM_TxDbm; //indicates current tx power
  6836. uint8_t nTSM_Maio;
  6837. uint8_t nTSM_Hsn;
  6838. uint8_t nTSM_RxLevSub;
  6839. uint8_t nTSM_RxLevFull;
  6840. uint8_t nTSM_RxLev;
  6841. uint8_t nTSM_Dtx_used;
  6842. uint8_t pad[3];
  6843. } CFW_TSM_CURR_CELL_INFO;
  6844. typedef struct _CFW_TSM_CURR_CELL_INFO_V2
  6845. {
  6846. uint16_t nTSM_Arfcn; //Absolute Radio Frequency Channel Number ,[0..1023].
  6847. uint8_t nTSM_Rla; // Averaged measure
  6848. uint8_t nTSM_LAI[5]; //Location Area Identification.
  6849. uint8_t nTSM_RAC; //Routing Area Code ( GPRS only), [0..255].
  6850. #if (defined LTE_NBIOT_SUPPORT) || (defined LTE_SUPPORT)
  6851. uint8_t nTSM_CellID[4]; //Cell Identity.
  6852. #else
  6853. uint8_t nTSM_CellID[2]; //Cell Identity.
  6854. #endif
  6855. uint8_t nTSM_Bsic; //Synchronisation code,[0..63].
  6856. bool nTSM_BCCHDec; //Indicates if the BCCH info has been decoded on the cell.
  6857. uint8_t nTSM_NetMode; //Network Mode of Operation (GPRS only),[0..2].
  6858. uint8_t nTSM_AvRxLevel; //Average Rx level in Abs Val of dBm ,[0..115].
  6859. uint8_t nTSM_MaxTxPWR; //Max allowed transmit power, [0..31].
  6860. int8_t nTSM_C1Value; //Cell quality ,[-33..110].
  6861. uint8_t nTSM_BER; //Bit Error Rate [0..255],255 = non significant.
  6862. uint8_t nTSM_TimeADV; //Timing Advance (valid in GSM connected mode only).[0..255] 255 = non significant.
  6863. uint8_t nTSM_CCCHconf; //ccch configuration
  6864. //0:CCCH_1_CHANNEL_WITH_SDCCH meanning 1 basic physical channel used for CCCH, combined with SDCCH
  6865. //1:CCCH_1_CHANNEL meanning 1 basic physical channel used for CCCH, not combined with SDCCH
  6866. //2:CCCH_2_CHANNEL meanning 2 basic physical channel used for CCCH, not combined with SDCCH
  6867. //3:CCCH_3_CHANNEL meanning 3 basic physical channel used for CCCH, not combined with SDCCH
  6868. //4:CCCH_4_CHANNEL meanning 4 basic physical channel used for CCCH, not combined with SDCCH
  6869. //0xFF:INVALID_CCCH_CHANNEL_NUM meanning Invalid value
  6870. uint8_t nTSM_BsPaMfrms; // BS-PA-MFRMS
  6871. uint8_t nTSM_RxQualFull; //receive quality full [0~7]
  6872. uint8_t nTSM_RxQualSub; //receive quality sub [0~7]
  6873. int16_t nTSM_C2; //Value of the cell reselection criterium [-96~173]
  6874. uint8_t nTSM_CurrBand; //current band used,possible value see below
  6875. uint8_t nTSM_CurrChanType; //Current channel type
  6876. //0:CHANNEL_TYPE_SDCCH meanning Current channel type is SDCCH
  6877. //1:CHANNEL_TYPE_TCH_H0 meanning Current channel type is TCH ,half rate,Subchannel 0
  6878. //2:CHANNEL_TYPE_TCH_H1 meanning Current channel type is TCH ,half rate,Subchannel 1
  6879. //3:CHANNEL_TYPE_TCH_F meanningCurrent channel type is TCH ,full rate
  6880. //0xff:INVALID_CHANNEL_TYPE meanning Invalid channel type
  6881. uint32_t nTSM_CurrChanMode; //current channel mode ,only valid in decicated mode
  6882. //API_SIG_ONLY 1<<0 signalling only
  6883. //API_SPEECH_V1 1<<1 speech full rate or half rate version 1
  6884. //API_SPEECH_V2 1<<2 speech full rate or half rate version 2
  6885. //API_SPEECH_V3 1<<3 speech full rate or half rate version 3
  6886. //API_43_14_KBS 1<<4 data, 43.5kbit/s dwnlnk, 14.5kbit/s uplnk
  6887. //API_29_14_KBS 1<<5 data, 29.0kbit/s dwnlnk, 14.5kbit/s uplnk
  6888. //API_43_29_KBS 1<<6 data, 43.5kbit/s dwnlnk, 29.0kbit/s uplnk
  6889. //API_14_43_KBS 1<<7 data, 14.5kbit/s dwnlnk, 43.5kbit/s uplnk
  6890. //API_14_29_KBS 1<<8 data, 14.5kbit/s dwnlnk, 29.0kbit/s uplnk
  6891. //API_29_43_KBS 1<<9 data, 29.0kbit/s dwnlnk, 43.5kbit/s uplnk
  6892. //API_43_KBS 1<<10 data, 43.5kbit/s
  6893. //API_32_KBS 1<<11 data, 32.0kbit/s
  6894. //API_29_KBS 1<<12 data, 29.0kbit/s
  6895. //API_14_KBS 1<<13 data, 14.5kbit/s
  6896. //API_12_KBS 1<<14 data, 12.0kbit/s
  6897. //API_6_KBS 1<<15 data, 6.0kbit/s
  6898. //API_3_KBS 1<<16 data, 3.6kbit/s
  6899. //API_INVALID_CHAN_MODE 0xFFFFFFFF Invalid channel mode
  6900. //9:BAND_GSM900 meanning Band GSM900P, GSM900E and GSM900R
  6901. //18:BAND_DCS1800 meanning Band DCS1800
  6902. //19:BAND_PCS1900 meanning Band PCS 1900
  6903. //0xFF:BAND_INVALID meanning Invalid band value
  6904. uint8_t nTSM_MaxRetrans; //max number of random access retransmission 1,2,4,7
  6905. uint8_t nTSM_BsAgBlkRes; //block number kept for AGCH in common channel [0~7]
  6906. uint8_t nTSM_AC[2]; //Access Class [0~255]
  6907. uint8_t nTSM_RxLevAccMin; //receive level access minimum [0~63]
  6908. bool bTSM_EC; //Indicates if emergency call has been allowed
  6909. bool bTSM_SI7_8; //Indicates if SI7 and 8 are broadcast
  6910. bool bTSM_ATT; //Indicates if IMSI attach has been allowed
  6911. uint8_t nTSM_RxDbm; //indicates current rx power
  6912. uint8_t nTSM_TxDbm; //indicates current tx power
  6913. uint8_t nTSM_Maio;
  6914. uint8_t nTSM_Hsn;
  6915. uint8_t nTSM_RxLevSub;
  6916. uint8_t nTSM_RxLevFull;
  6917. uint8_t nTSM_RxLev;
  6918. uint8_t nTSM_Dtx_used;
  6919. uint8_t pad[3];
  6920. uint8_t nTSM_ts; //number format
  6921. } CFW_TSM_CURR_CELL_INFO_V2;
  6922. typedef struct _CFW_TSM_NEIGHBOR_CELL_INFO
  6923. {
  6924. uint16_t nTSM_Arfcn; //Absolute Radio Frequency Channel Number ,[0..1023].
  6925. uint8_t nTSM_CellID[2]; //Cell Identity.
  6926. uint8_t nTSM_AvRxLevel; //Average Rx level in Abs Val of dBm ,[0..115].==RSSI
  6927. uint8_t nTSM_Bsic; //Synchronisation code,[0..63].
  6928. bool nTSM_BCCHDec; //Indicates if the BCCH info has been decoded on the cell.
  6929. uint8_t nTSM_MaxTxPWR; //Max allowed transmit power, [0..31].
  6930. uint8_t nTSM_RxLevAM; //RxLev Access Min in RxLev [0..63].
  6931. int8_t nTSM_C1Value; //Cell quality ,[-33..110].see 05.08
  6932. uint8_t nTSM_LAI[5]; //Location Area Identification.
  6933. int16_t nTSM_C2; //Value of the cell reselection criterium [-96~173]
  6934. int16_t nTSM_C31;
  6935. int16_t nTSM_C32;
  6936. } CFW_TSM_NEIGHBOR_CELL_INFO;
  6937. typedef struct _CFW_TSM_ALL_NEBCELL_INFO
  6938. {
  6939. uint8_t nTSM_NebCellNUM; ///< neighbor cell number.
  6940. CFW_TSM_NEIGHBOR_CELL_INFO nTSM_NebCell[10]; ///< the max of the neighbor cell is 6.
  6941. uint8_t pad[3];
  6942. } CFW_TSM_ALL_NEBCELL_INFO;
  6943. typedef struct _CFW_TSM_NEIGHBOR_CELL_INFO_V2
  6944. {
  6945. uint16_t nTSM_Arfcn; //Absolute Radio Frequency Channel Number ,[0..1023].
  6946. uint8_t nTSM_CellID[2]; //Cell Identity.
  6947. uint8_t nTSM_AvRxLevel; //Average Rx level in Abs Val of dBm ,[0..115].==RSSI
  6948. uint8_t nTSM_Bsic; //Synchronisation code,[0..63].
  6949. bool nTSM_BCCHDec; //Indicates if the BCCH info has been decoded on the cell.
  6950. uint8_t nTSM_MaxTxPWR; //Max allowed transmit power, [0..31].
  6951. uint8_t nTSM_RxLevAM; //RxLev Access Min in RxLev [0..63].
  6952. int8_t nTSM_C1Value; //Cell quality ,[-33..110].see 05.08
  6953. uint8_t nTSM_LAI[5]; //Location Area Identification.
  6954. int16_t nTSM_C2; //Value of the cell reselection criterium [-96~173]
  6955. int16_t nTSM_C31;
  6956. int16_t nTSM_C32;
  6957. uint32_t nTSM_EArfcn;
  6958. int16_t nTSM_CellIdentity;
  6959. int16_t nTSM_RSRP;
  6960. int16_t nTSM_RSRQ;
  6961. } CFW_TSM_NEIGHBOR_CELL_INFO_V2;
  6962. typedef struct _CFW_TSM_ALL_NEBCELL_INFO_V2
  6963. {
  6964. uint8_t nTSM_NebCellNUM; ///< neighbor cell number.
  6965. uint8_t LTEAdjCellNb;
  6966. CFW_TSM_NEIGHBOR_CELL_INFO_V2 nTSM_NebCell[20]; ///< the max of the neighbor cell is 6.
  6967. uint8_t pad[3];
  6968. } CFW_TSM_ALL_NEBCELL_INFO_V2;
  6969. typedef struct _CFW_TSM_FUNCTION_SELECT
  6970. {
  6971. bool nServingCell; ///< true:enable the function ,false:disable.
  6972. bool nNeighborCell; ///< true:enable the function ,false:disable.
  6973. uint8_t nCurrentNetMode;
  6974. uint16_t nCurrentUti;
  6975. uint8_t pad[2];
  6976. } CFW_TSM_FUNCTION_SELECT;
  6977. typedef struct _CFW_TUE_STATUS_INFO
  6978. {
  6979. uint32_t dlEarfcn;
  6980. uint16_t pcid;
  6981. int16_t rsrp;
  6982. int16_t rsrq;
  6983. uint16_t sinr;
  6984. uint16_t mcl;
  6985. uint16_t ulMcs;
  6986. uint16_t dlMcs;
  6987. uint16_t mpdcchRepNum;
  6988. uint16_t puschRepNum;
  6989. uint16_t pdschRepNum;
  6990. uint16_t ulInitialBler;
  6991. uint16_t dlInitialBler;
  6992. uint32_t ulRbNum;
  6993. uint32_t dlRbNum;
  6994. uint32_t ulRlcRate;
  6995. uint32_t dlRlcRate;
  6996. uint32_t ulTbs;
  6997. uint32_t dlTbs;
  6998. } CFW_TUE_STATUS_INFO;
  6999. void CFW_GetStatusInfo(CFW_TUE_STATUS_INFO *nStatusInfo, CFW_SIM_ID nSimID);
  7000. bool CFW_GetScanRssiInfo(uint8_t band, uint8_t index, uint16_t *pFreqsNums, int16_t rssi[400], CFW_SIM_ID nSimID);
  7001. /***************************************API FUNCTION OF TSM***********************************************/
  7002. uint32_t CFW_GetAoHandle(uint8_t nIndex, uint32_t nState, uint32_t nServiceId, CFW_SIM_ID nSimID);
  7003. uint32_t CFW_EmodOutfieldTestStart(CFW_TSM_FUNCTION_SELECT *pSelecFUN, uint16_t nUTI, CFW_SIM_ID nSimID);
  7004. uint32_t CFW_EmodOutfieldTestStartV2(CFW_TSM_FUNCTION_SELECT *pSelecFUN, uint16_t nUTI, CFW_SIM_ID nSimID);
  7005. uint32_t CFW_EmodOutfieldTestEnd(uint16_t nUTI, CFW_SIM_ID nSimID);
  7006. uint32_t CFW_GetCellInfo(CFW_TSM_CURR_CELL_INFO *pCurrCellInfo, CFW_TSM_ALL_NEBCELL_INFO *pNeighborCellInfo, CFW_SIM_ID nSimID);
  7007. uint32_t CFW_GetCellInfoV2(CFW_TSM_CURR_CELL_INFO_V2 *pCurrCellInfo, CFW_TSM_ALL_NEBCELL_INFO_V2 *pNeighborCellInfo, CFW_SIM_ID nSimID);
  7008. uint8_t *CFW_EmodGetBaseBandVersionV1(void);
  7009. uint32_t CFW_EmodSyncInfoTest(bool bStart, uint16_t nUTI, CFW_SIM_ID nSimID);
  7010. #define CFW_SYNC_INFO_IND 0x01
  7011. #define CFW_POWER_LIST_IND 0x02
  7012. #define CFW_EMOD_POWER_LIST_COUNT 50
  7013. typedef struct
  7014. {
  7015. uint16_t nArfcn;
  7016. uint16_t nRssi;
  7017. } CFW_EmodPowerInfo;
  7018. typedef struct
  7019. {
  7020. CFW_EmodPowerInfo nPowerList[CFW_EMOD_POWER_LIST_COUNT];
  7021. uint8_t nCount;
  7022. } CFW_EmodPowerListInd;
  7023. typedef enum
  7024. {
  7025. PHY_VERSION,
  7026. STACK_VERSION,
  7027. PHY_CFG_VERSION,
  7028. CSW_VERSION,
  7029. MMI_VERSION,
  7030. SOFT_VERSION_ENUM_FILL = 0x7fffffff
  7031. } SOFT_VERSION;
  7032. typedef enum
  7033. {
  7034. XCV_VERSION,
  7035. PA_VERSION,
  7036. SW_VERSION,
  7037. CHIP_VERSION,
  7038. FLASH_VERSION,
  7039. HW_VERSION_ENUM_FILL = 0x7fffffff
  7040. } HW_VERSION;
  7041. typedef struct _Soft_Version
  7042. {
  7043. uint8_t nVersion[30];
  7044. uint32_t nDate;
  7045. } Soft_Version;
  7046. typedef struct _HW_Version
  7047. {
  7048. uint8_t nVersion[30];
  7049. } HW_Version;
  7050. uint32_t reg_GetRegSize(void);
  7051. int32_t REG_Read(uint32_t ulAddrOffset, uint8_t *pBuffer, uint32_t ulBytesToRead, uint32_t *pBytesRead);
  7052. int32_t REG_Write(uint32_t ulAddrOffset, const uint8_t *pBuffer, uint32_t ulBytesToWrite, uint32_t *pBytesWritten);
  7053. //hameina[+]20081031 for bug 10176
  7054. //
  7055. void CFW_CcSetCSSI(bool nCSSI);
  7056. void CFW_CcSetCSSU(bool nCSSU);
  7057. uint32_t CFW_GetFreeCID(uint8_t *pCID, CFW_SIM_ID nSimID);
  7058. uint32_t CFW_ReleaseCID(uint8_t nCID, CFW_SIM_ID nSimID);
  7059. uint32_t CFW_SetCID(uint8_t nCID, CFW_SIM_ID nSimID);
  7060. uint8_t CFW_isPdpActiveAvailable(CFW_SIM_ID nSimID);
  7061. //#ifdef CFW_EXTENDED_API
  7062. uint32_t cfw_SimReadElementaryFile(uint16_t nUTI, uint32_t fileId, CFW_SIM_ID nSimID);
  7063. uint32_t CFW_SimGetACMMax(uint16_t nUTI, CFW_SIM_ID nSimID);
  7064. uint32_t CFW_SimSetACMMax(uint32_t iACMMaxValue, uint8_t *pPin2, uint8_t nPinSize, uint16_t Nuti, CFW_SIM_ID nSimID);
  7065. uint32_t CFW_SimGetACM(uint16_t nUTI, CFW_SIM_ID nSimID);
  7066. uint32_t CFW_SimSetACM(uint32_t iCurValue, uint8_t *pPin2, uint8_t nPinSize, uint16_t Nuti, CFW_SIM_ID nSimID);
  7067. uint32_t CFW_SimGetPUCT(uint16_t nUTI, CFW_SIM_ID nSimID);
  7068. uint32_t CFW_SimSetPUCT(CFW_SIM_PUCT_INFO *pPUCT, uint8_t *pPin2, uint8_t nPinSize, uint16_t nUTI, CFW_SIM_ID nSimID);
  7069. void CFW_EmodSetLteLockFreq(uint8_t number, uint32_t *freq, CFW_SIM_ID nSimId);
  7070. void CFW_EmodGetLteLockFreq(uint8_t *number, uint32_t freq[9], CFW_SIM_ID nSimId);
  7071. void CFW_EmodSetLteLockBand(uint8_t number, uint16_t *band, CFW_SIM_ID nSimId);
  7072. void CFW_EmodGetLteLockBand(uint8_t *number, uint16_t band[20], CFW_SIM_ID nSimId);
  7073. void CFW_EmodSetLteLockBandV2(uint8_t number, uint16_t *band, CFW_SIM_ID nSimId);
  7074. uint32_t CFW_EmodGetLteBand(uint8_t *number, uint16_t band[24], CFW_SIM_ID nSimId);
  7075. uint32_t CFW_EmodSetLteBand(uint8_t number, uint16_t *band, CFW_SIM_ID nSimId);
  7076. uint16_t CFW_GetBandFromFreq(uint32_t freq);
  7077. void CFW_EmodGetLteLockBandV2(uint8_t *number, uint16_t band[5], CFW_SIM_ID nSimId);
  7078. void CFW_EmodGetLteLockTddOrFdd(uint8_t *tddfdd, CFW_SIM_ID nSimId);
  7079. void CFW_EmodSetLteLockTddOrFdd(uint8_t tddfdd, CFW_SIM_ID nSimId);
  7080. void CFW_EmodSetLteLockCell(uint16_t Cell, CFW_SIM_ID nSimId);
  7081. void CFW_EmodGetLteLockCell(uint16_t *Cell, CFW_SIM_ID nSimId);
  7082. void CFW_EmodGetCEMode(uint8_t *pMode, CFW_SIM_ID nSimID);
  7083. void CFW_EmodSetCEMode(uint8_t nMode, CFW_SIM_ID nSimID);
  7084. void CFW_EmodGetVoicePrefer(uint8_t *pVoicePrefer, CFW_SIM_ID nSimID);
  7085. void CFW_EmodSetVoicePrefer(uint8_t nVoicePrefer, CFW_SIM_ID nSimID);
  7086. //Add by wcf, 2015/1/21, process polling timer
  7087. #ifdef _SIM_HOT_PLUG_
  7088. void CFW_SetPollingTimer(uint8_t PollingInterval, CFW_SIM_ID nSimID);
  7089. void CFW_GetPollingTimer(uint8_t *pPollingInterval, CFW_SIM_ID nSimID);
  7090. #endif
  7091. //End, process polling timer
  7092. void CSW_FacilityCrssDeflec(
  7093. uint8_t nIndex,
  7094. CFW_SIM_ID nSimId,
  7095. uint8_t DTN[20], ///< Deflec number
  7096. uint8_t DTNLen,
  7097. uint8_t DTSA[21], ///< sub number
  7098. uint8_t DTSALen);
  7099. #define ICCID_LENGTH 10
  7100. uint8_t *CFW_GetICCID(CFW_SIM_ID nSimID);
  7101. #define FIRST_MATCH 0xA5
  7102. #define ALL_MATCH 0x5A
  7103. #define WILDCARD_MATCH 0x55
  7104. #define SEEK_SIM_ADN 0
  7105. #define SEEK_SIM_FDN 1
  7106. #define SEEK_SIM_MSISDN 2
  7107. #define SEEK_SIM_BDN 3
  7108. #define SEEK_SIM_SDN 4
  7109. #define SEEK_SIM_LND 5
  7110. #define SEEK_SIM_NAME 3
  7111. #define SEEK_SIM_NUMBER 4
  7112. #define SEEK_SIM_USED 5
  7113. typedef struct _CFW_SIM_PBK_INFO
  7114. {
  7115. uint16_t nIndex;
  7116. uint8_t nType;
  7117. uint8_t nLengthAl;
  7118. uint8_t nLengthNb;
  7119. uint8_t nAlpha[40];
  7120. uint8_t nNumber[20];
  7121. } CFW_SIM_PBK_INFO;
  7122. typedef struct _CFW_SIM_SEARCH_PBK
  7123. {
  7124. uint16_t nMatchRecords; ///< is the number of the LV
  7125. uint16_t nUsedRecords; ///< is the number of the LV
  7126. uint16_t nTotalRecords;
  7127. uint8_t nData[0]; ///< nData is composed of two bytes index, one byte type,
  7128. //one byte length of name and name
  7129. //one byte length of numbre and number
  7130. } CFW_SIM_SEARCH_PBK;
  7131. uint32_t CFW_CfgNwGetOperatorIdEx(
  7132. uint8_t **pOperatorId,
  7133. uint8_t *pOperatorName,
  7134. uint8_t format,
  7135. uint32_t *idx);
  7136. uint32_t CFW_CfgNwGetOperatorNameEx(
  7137. uint8_t pOperatorId[6],
  7138. uint8_t **pOperatorName,
  7139. uint8_t **pOperatorShortName);
  7140. uint32_t CFW_NwDeRegisterEx(
  7141. uint16_t nUTI,
  7142. uint8_t detachType,
  7143. bool poweroff,
  7144. CFW_SIM_ID nSimID);
  7145. typedef enum _CFW_CALL_CLIR_E
  7146. {
  7147. CFW_CALL_CLIR_INVOCATION = 1,
  7148. CFW_CALL_CLIR_SUPPRESSION,
  7149. CFW_CALL_CLIR_NETWORK_DECIDE
  7150. } CFW_CALL_CLIR_E;
  7151. typedef enum CFW_VOICE_MAIL_TYPE_E
  7152. {
  7153. CFW_VOICE_MAIL,
  7154. CFW_VOICE_MAIL_FAX,
  7155. CFW_VOICE_MAIL_EMAIL,
  7156. CFW_VOICE_MAIL_OTHER,
  7157. CFW_VOICE_MAIL_VERSION_ENUM_FILL = 0x7fffffff
  7158. } CFW_VOICE_MAIL_TYPE_E;
  7159. typedef struct _CFW_SIM_INFO_VOICEMAIL
  7160. {
  7161. uint8_t alpha_id_len;
  7162. uint8_t mailbox_number_len;
  7163. uint8_t ccp_id;
  7164. bool is_ext_exist;
  7165. uint8_t ext_id;
  7166. bool is_ccp_exist;
  7167. bool is_ton_npi_exist;
  7168. uint8_t alpha_id[20];
  7169. uint8_t mailbox_number[10];
  7170. uint8_t ton;
  7171. uint8_t npi;
  7172. CFW_VOICE_MAIL_TYPE_E vm_type;
  7173. bool is_voicemail_exist;
  7174. uint8_t line_index;
  7175. } CFW_SIM_INFO_VOICEMAIL;
  7176. typedef struct _CFW_SIM_INFO_READVOICEMAILINFO
  7177. {
  7178. uint8_t n_PrevStatus;
  7179. uint8_t n_CurrStatus;
  7180. uint8_t nTryCount;
  7181. uint8_t nCurrentFile;
  7182. uint8_t nTotalRecordNumber;
  7183. uint8_t RecordLength;
  7184. uint8_t nStatus;
  7185. uint8_t nCurrInd;
  7186. uint8_t nDataSize;
  7187. uint8_t nLine_index;
  7188. CFW_VOICE_MAIL_TYPE_E nVoiceMailType;
  7189. CFW_SIM_INFO_VOICEMAIL vm_content;
  7190. uint8_t pattern[5];
  7191. } CFW_SIM_INFO_READVOICEMAILINFO;
  7192. typedef struct _CFW_SIM_SMS_PARAMETERS
  7193. {
  7194. uint8_t nSMSCInfo[12];
  7195. uint8_t nPID;
  7196. uint8_t nDCS;
  7197. uint8_t nVP;
  7198. uint8_t nFlag;
  7199. } CFW_SIM_SMS_PARAMETERS;
  7200. typedef struct _TM_ALARM
  7201. {
  7202. uint32_t nFileTime;
  7203. uint8_t *pText;
  7204. uint8_t nTextLength;
  7205. uint8_t nRecurrent;
  7206. uint8_t padding[2];
  7207. uint16_t nIndex;
  7208. uint16_t nType;
  7209. } TM_ALARM;
  7210. uint32_t CFW_CcCallMultipartyFunction(uint8_t nFun, CFW_SIM_ID nSimId);
  7211. uint32_t CFW_SimReadVoiceMailInfo(uint8_t nLineId, CFW_VOICE_MAIL_TYPE_E nType, uint16_t nUTI, CFW_SIM_ID nSimID);
  7212. uint32_t CFW_SimUpdateVoiceMailInfo(uint8_t nLineId, CFW_VOICE_MAIL_TYPE_E nType, CFW_SIM_INFO_VOICEMAIL *pVoiceMail, uint16_t nUTI, CFW_SIM_ID nSimID);
  7213. typedef struct
  7214. {
  7215. uint16_t success; ///< success times
  7216. uint16_t fail; ///< failure times
  7217. uint16_t passRatio; ///< success rate
  7218. uint32_t delay; ///< delay time,unit:ms
  7219. } cfw_statistic_t;
  7220. typedef struct
  7221. {
  7222. uint16_t dropOn2g; ///< drop times on gsm
  7223. uint16_t dropOn4g; ///< drop times on lte
  7224. } cfw_dropTimes_t;
  7225. typedef struct
  7226. {
  7227. uint32_t timeOn2g; ///< time on gsm registered
  7228. uint32_t timeOn4g; ///< time on lte registered
  7229. uint32_t timeOnVolte; ///< time on volte registered
  7230. uint32_t timeOnUnknow; ///< time on no RAT or drop
  7231. uint32_t allTheTime; ///< total time from power on
  7232. } cfw_attachTime_t;
  7233. typedef struct
  7234. {
  7235. cfw_statistic_t handoverStatistic[8]; ///< 0:GToGHO,1:GToGCCO,2:GToLCCO,3:LToGCCO,4:GToLHO,5:LToLHO,6:LToGHO,7:SRVCC
  7236. } cfw_handoverInfo_t;
  7237. typedef struct
  7238. {
  7239. cfw_statistic_t reselStatistic[4]; ///< 0:GToLResel,1:GToLResel,2:LToLResel,3:LToGResel
  7240. } cfw_reselectInfo_t;
  7241. typedef struct
  7242. {
  7243. uint8_t lteCipherFlag; ///< default value 1
  7244. uint8_t bsrvccFlag; ///< default value 1
  7245. uint8_t emfbiFlag; ///< default value 1
  7246. uint8_t ipv6Flag; ///< default value 1
  7247. uint8_t asrvccFlag; ///< default value 1
  7248. uint8_t esrvccFlag; ///< default value 1
  7249. } cfw_capInfoLte_t;
  7250. typedef struct
  7251. {
  7252. uint32_t arfcn;
  7253. uint16_t bsic; ///< if not decode BSIC,apply 0xffff
  7254. uint16_t rxlev;
  7255. } cfw_gsmNcell_t;
  7256. typedef struct
  7257. {
  7258. uint8_t validFlag; //0: plmn/enodeBID/cellId/tac are invalid, 1:plmn/enodeBID/cellId/tac are valid
  7259. uint8_t plmn[3];
  7260. uint32_t enodeBID; //first 20 bits of SIB1 cell identity
  7261. uint16_t cellId; //default value 0xff
  7262. uint16_t tac; //serving tac(from SIB1)
  7263. } cfw_lteCellAccessRelatedInfo_t; //CellAccessRelatedInfo
  7264. typedef struct
  7265. {
  7266. uint32_t frequency;
  7267. uint16_t pcid; ///< if not decode BSIC,apply 0xffff
  7268. uint16_t bandWidth;
  7269. int16_t rsrp;
  7270. int16_t rsrq;
  7271. int16_t Srxlev;
  7272. cfw_lteCellAccessRelatedInfo_t cellAccRelInfo;
  7273. } cfw_lteNcell_t;
  7274. typedef struct
  7275. {
  7276. uint8_t plmn[3];
  7277. uint8_t imsi[16]; ///< imsi[0]:length of IMSI
  7278. uint8_t roamingFlag; ///< 1:roaming,0:non roaming
  7279. uint16_t bandInfo; ///< band1-band256
  7280. uint32_t dlEarfcn; ///< 0-262143, invalid value 0xffffffff
  7281. uint16_t pcid;
  7282. int16_t rsrp;
  7283. int16_t rsrq;
  7284. int16_t Srxlev;
  7285. uint16_t tsMode; ///< default value 0xffff
  7286. uint16_t bandwidth; ///< default value 0xffff
  7287. uint16_t SA; ///< default value 0xffff
  7288. uint16_t SSP; ///< default value 0xffff
  7289. uint16_t SINR;
  7290. uint32_t ulMcs; ///< default value 0xffff
  7291. uint32_t dlMcs; ///< default value 0xffff
  7292. uint8_t ulBler;
  7293. uint8_t dlBler;
  7294. uint32_t enodeBID; ///< first 20 bits of SIB1 cell identity
  7295. uint16_t cellId; ///< default value 0xff
  7296. uint16_t tac; //serving tac(from SIB1)
  7297. uint16_t netMode; //0--tdd 1--fdd
  7298. int16_t rxPower; //Dl receiving power; Real value(Unit:dbm)=rxPower divide 16.
  7299. int16_t txPower; //UE transmits power, -46~23 dbm
  7300. int16_t rssi;
  7301. } cfw_lteScell_t;
  7302. typedef struct
  7303. {
  7304. cfw_lteScell_t lteScell;
  7305. uint16_t lteNcellNum;
  7306. cfw_lteNcell_t lteNcell[9];
  7307. uint16_t gsmNcellNum;
  7308. cfw_gsmNcell_t gsmNcell[5];
  7309. cfw_capInfoLte_t capInfoLte;
  7310. } cfw_nwCapLte_t;
  7311. typedef struct
  7312. {
  7313. uint32_t vamos;
  7314. uint32_t diversityGsm;
  7315. uint8_t Plmn[3];
  7316. bool Roaming;
  7317. uint8_t CellId[2];
  7318. uint16_t Arfcn;
  7319. uint8_t Bsic;
  7320. uint8_t Rla;
  7321. uint8_t Lai[5];
  7322. } cfw_ueCapGsm_t;
  7323. typedef struct
  7324. {
  7325. cfw_ueCapGsm_t ueCapabilityGsm;
  7326. cfw_nwCapLte_t nwCapabilityLte;
  7327. } CFW_NET_INFO_T;
  7328. typedef struct
  7329. {
  7330. uint8_t validFlag; /*0: invalid; 1:valid */
  7331. uint8_t reselPriority; /*小区重选优先级,范围0~7,无效值0xFF。*/
  7332. uint8_t threshXLow; /*低优先级小区重选门限threshX-Low,范围0~62.*/
  7333. uint8_t threshXHigh; /*高优先级小区重选门限threshX-High,范围0~62.*/
  7334. uint8_t nccPermit; /* NCC PERMIT,范围0~255.*/
  7335. uint8_t reserver[3];
  7336. } cfw_gsmCellReselInfo_t;
  7337. typedef struct
  7338. {
  7339. uint32_t arfcn;
  7340. uint16_t bsic; ///< if not decode BSIC,apply 0xffff
  7341. uint16_t rxlev;
  7342. int16_t srxlev;
  7343. uint16_t reserved;
  7344. cfw_gsmCellReselInfo_t gsmCellReselInfo;
  7345. } cfw_gsmNcell_t_V2;
  7346. typedef struct
  7347. {
  7348. uint8_t validFlag; /*0: invalid; 1:valid */
  7349. uint8_t reselPriority; /*0~7, invalid value:255*/
  7350. uint8_t threshXLow; /*0~62*/
  7351. uint8_t threshXHigh; /*0~62*/
  7352. } cfw_lteCellReselInfo_t;
  7353. typedef struct
  7354. {
  7355. uint32_t frequency;
  7356. uint16_t pcid; ///< if not decode BSIC,apply 0xffff
  7357. uint16_t bandWidth;
  7358. int16_t rsrp;
  7359. int16_t rsrq;
  7360. int16_t Srxlev;
  7361. uint16_t sinr; /*小区的SINR,单位db。*/
  7362. int16_t rssi; /*小区的RSSI,单位dbm。*/
  7363. uint16_t cellType; /*0:intra lte ncell, 1:inter lte ncell */
  7364. cfw_lteCellAccessRelatedInfo_t cellAccRelInfo;
  7365. cfw_lteCellReselInfo_t cellReselInfo; /* 小区的重选相关信息*/
  7366. } cfw_lteNcell_t_V2;
  7367. typedef struct
  7368. {
  7369. uint8_t plmn[3];
  7370. uint8_t imsi[16]; ///< imsi[0]:length of IMSI
  7371. uint8_t roamingFlag; ///< 1:roaming,0:non roaming
  7372. uint16_t bandInfo; ///< band1-band256
  7373. uint32_t dlEarfcn; ///< 0-262143, invalid value 0xffffffff
  7374. uint16_t pcid;
  7375. int16_t rsrp;
  7376. int16_t rsrq;
  7377. int16_t Srxlev;
  7378. uint16_t tsMode; ///< default value 0xffff
  7379. uint16_t bandwidth; ///< default value 0xffff
  7380. uint16_t SA; ///< default value 0xffff
  7381. uint16_t SSP; ///< default value 0xffff
  7382. uint16_t SINR;
  7383. uint32_t ulMcs; ///< default value 0xffff
  7384. uint32_t dlMcs; ///< default value 0xffff
  7385. uint8_t ulBler;
  7386. uint8_t dlBler;
  7387. uint32_t enodeBID; ///< first 20 bits of SIB1 cell identity
  7388. uint16_t cellId; ///< default value 0xff
  7389. uint16_t tac; //serving tac(from SIB1)
  7390. uint16_t netMode; //0--tdd 1--fdd
  7391. int16_t rxPower; //Dl receiving power; Real value(Unit:dbm)=rxPower divide 16.
  7392. int16_t txPower; //UE transmits power, -46~23 dbm
  7393. int16_t rssi;
  7394. uint16_t ulBandWidth; /*服务小区ul_bandwidth, default value 0xffff*/
  7395. uint16_t threshServingLow; /*服务小区低优先级重选门限threshServingLow;范围0~62。*/
  7396. uint16_t sNonIntraSearch; /*服务小区异频测量门限s-NonIntraSearch;范围0~62。*/
  7397. uint16_t sIntraSearch; /*服务小区同频测量门限s-IntraSearch;范围0~62。*/
  7398. } cfw_lteScell_t_V2; // 服务小区
  7399. typedef struct
  7400. {
  7401. uint32_t frequency;
  7402. uint16_t freqType; /*0:intra lte freq, 1:inter lte freq*/
  7403. uint16_t reserverd;
  7404. cfw_lteCellReselInfo_t cellReselInfo;
  7405. } cfw_lteFreq_t;
  7406. typedef struct
  7407. {
  7408. cfw_lteScell_t_V2 lteScell;
  7409. uint16_t lteNcellNum;
  7410. cfw_lteNcell_t_V2 lteNcell[9];
  7411. uint16_t gsmNcellNum;
  7412. cfw_gsmNcell_t_V2 gsmNcell[5];
  7413. cfw_capInfoLte_t capInfoLte;
  7414. uint16_t state; /*0:search 1: limit serve 2:no connect 3:connect*/
  7415. uint16_t lteNFreqNum;
  7416. cfw_lteFreq_t lteNFreq[9]; // No cell frequency
  7417. } cfw_nwCapLte_t_V2;
  7418. typedef struct
  7419. {
  7420. cfw_ueCapGsm_t ueCapabilityGsm;
  7421. cfw_nwCapLte_t_V2 nwCapabilityLte;
  7422. } CFW_NET_INFO_T_V2;
  7423. typedef struct
  7424. {
  7425. cfw_reselectInfo_t reselectInfo;
  7426. cfw_handoverInfo_t handoverInfo;
  7427. cfw_attachTime_t attachTime;
  7428. cfw_dropTimes_t dropTimes;
  7429. } CFW_NET_INFO_STATISTIC_T;
  7430. uint32_t CFW_GetNetinfo(CFW_NET_INFO_T *pNetinfo, CFW_SIM_ID nSimID);
  7431. uint32_t CFW_GetLETRealTimeInfo(CFW_NET_INFO_T *pNetinfo, CFW_SIM_ID nSimID);
  7432. uint32_t CFW_GetLETRealTimeInfoV2(CFW_NET_INFO_T_V2 *pNetinfo, CFW_SIM_ID nSimID);
  7433. uint32_t CFW_GetLETRealTimeInfoV3(CFW_NET_INFO_T_V2 *pNetinfo, CFW_SIM_ID nSimID);
  7434. bool CFW_CheckSupportLteBand(uint16_t nBand, CFW_SIM_ID nSimID);
  7435. bool CFW_CheckSupportLteFreq(uint32_t nFreq, uint8_t dlOrUl, CFW_SIM_ID nSimID);
  7436. #ifdef CONFIG_SOC_6760
  7437. void Cfw_SetNl1cSigMod(uint8_t mode);
  7438. void Cfw_SetNl1cDlParas(uint16_t *dlps);
  7439. void Cfw_SetNl1cDlRcv(uint8_t enable);
  7440. void Cfw_SetNl1cUlParas(uint16_t *ulps);
  7441. void Cfw_SetNl1cUlRcv(uint8_t enable);
  7442. void Cfw_SetNl1cAPC(uint8_t flag, int16_t val);
  7443. void Cfw_SetNl1cAGC(uint8_t flag, int16_t val);
  7444. void Cfw_SetCarrierNum(uint16_t carrier);
  7445. #endif
  7446. bool CFW_GprsSendDataAvaliable(uint8_t nSimID);
  7447. uint32_t CFW_GprsSendData(uint8_t nCid, CFW_GPRS_DATA *pGprsData, uint8_t rai, CFW_SIM_ID nSimID);
  7448. extern uint32_t CFW_SwitchUSBShareNetwork(bool flag);
  7449. extern uint32_t CSW_SetAudioZspVqeCalibParam(uint8_t *resultcode, uint8_t *hasMsg,
  7450. uint8_t *resultMsg, uint8_t nMode, uint8_t nPath, uint8_t nCtrl, uint8_t *nParam, uint16_t nParamLength);
  7451. extern uint32_t CSW_SetAudioCodecCalibParam(uint8_t *resultcode, uint8_t *hasMsg,
  7452. uint8_t *resultMsg, uint8_t nMode, uint8_t nPath, uint8_t nCtrl, uint8_t *nParam, uint16_t nParamLength);
  7453. extern uint32_t CSW_SetAudioZspPreProcessCalibParam(uint8_t *resultcode, uint8_t *hasMsg,
  7454. uint8_t *resultMsg, uint8_t nMode, uint8_t nPath, uint8_t nCtrl, uint8_t *nParam, uint16_t nParamLength);
  7455. extern uint32_t CSW_SetAudioZspPostProcessCalibParam(uint8_t *resultcode, uint8_t *hasMsg,
  7456. uint8_t *resultMsg, uint8_t nMode, uint8_t nPath, uint8_t nCtrl, uint8_t *nParam, uint16_t nParamLength);
  7457. extern uint32_t CSW_WriteCalibParamToFlash(uint8_t *resultcode, uint8_t *hasMsg,
  7458. uint8_t *resultMsg, uint8_t nPath, uint8_t nCtrl, uint8_t *nParam, uint16_t nParamLength);
  7459. extern uint32_t CSW_ExportCalibOrImportCalibFlashParam(uint8_t *resultcode, uint8_t *hasMsg,
  7460. uint8_t *resultMsg, uint8_t nPath, uint8_t nCtrl, uint16_t nOffset, uint16_t nlength, uint8_t *nParam, uint16_t nParamLength);
  7461. extern uint32_t CSW_VersionControl(uint8_t *resultcode, uint8_t *hasMsg,
  7462. uint8_t *resultMsg, uint8_t nPath, uint8_t nCtrl, uint8_t *nParam, uint16_t nParamLength);
  7463. extern uint32_t CSW_DumpPcmDataToTflash(uint8_t *resultcode, uint8_t *hasMsg,
  7464. uint8_t *resultMsg, uint8_t nPath, uint8_t nCtrl, uint8_t *nParam, uint16_t nParamLength);
  7465. extern uint32_t CSW_SetAudioZspNxpCalibParam(uint8_t *resultcode, uint8_t *hasMsg,
  7466. uint8_t *resultMsg, uint8_t nMode, uint8_t nPath, uint8_t nCtrl, uint8_t *nParam, uint16_t nParamLength);
  7467. extern uint32_t CFW_SmsMemoryFullReq(uint8_t nCause, CFW_SIM_ID nSimID);
  7468. extern uint32_t CFW_SmsMMAReq(CFW_SIM_ID nSimID);
  7469. #define CFW_USIM_SOFT_KEY_LEN 16
  7470. #define CFW_USIM_SOFT_OP_LEN 16
  7471. #define CFW_USIM_SOFT_OPC_LEN 16
  7472. #define CFW_AUTH_C_PARAMTER_LENGTH 16
  7473. #define CFW_USIM_SOFT_IMSI_LEN 16
  7474. typedef struct
  7475. {
  7476. uint32_t enSoftUsimAlg;
  7477. uint8_t aucKey[CFW_USIM_SOFT_KEY_LEN];
  7478. uint8_t aucOp[CFW_USIM_SOFT_KEY_LEN];
  7479. } CFW_USIM_SOFT_AUTH_PARAM_STRU;
  7480. typedef struct
  7481. {
  7482. uint8_t R1;
  7483. uint8_t R2;
  7484. uint8_t R3;
  7485. uint8_t R4;
  7486. uint8_t R5;
  7487. uint8_t aucRsv[3];
  7488. uint8_t C1[CFW_AUTH_C_PARAMTER_LENGTH];
  7489. uint8_t C2[CFW_AUTH_C_PARAMTER_LENGTH];
  7490. uint8_t C3[CFW_AUTH_C_PARAMTER_LENGTH];
  7491. uint8_t C4[CFW_AUTH_C_PARAMTER_LENGTH];
  7492. uint8_t C5[CFW_AUTH_C_PARAMTER_LENGTH];
  7493. } CFW_SSIM_AMRC_STRU;
  7494. typedef struct
  7495. {
  7496. uint32_t bitOpcSoftUsimEnable : 1; // 1: VALID; 0: INVALID*, default : 0
  7497. uint32_t bitOpRsv : 31;
  7498. uint8_t aucOpc[CFW_USIM_SOFT_OPC_LEN];
  7499. } CFW_USIM_SOFT_OPC_PARAM_STRU;
  7500. typedef struct
  7501. {
  7502. uint8_t mncLen;
  7503. uint8_t imsi[CFW_USIM_SOFT_IMSI_LEN];
  7504. CFW_USIM_SOFT_AUTH_PARAM_STRU usim_soft_auth_param_stru;
  7505. CFW_USIM_SOFT_OPC_PARAM_STRU auth_opc;
  7506. CFW_SSIM_AMRC_STRU sim_amrc_stru;
  7507. } CFW_SSIM_FILE_INFO_T;
  7508. uint32_t CFW_SaveSsimFileInfo(CFW_SSIM_FILE_INFO_T ssim_file_info, CFW_SIM_ID nSimID);
  7509. uint32_t CFW_GenerateSoftSimImsi(uint8_t nPlmn[7], uint8_t nImei[16], uint8_t nImsi[16], uint8_t nKey[33]);
  7510. uint32_t CFW_SetGcfTest(CFW_SIM_ID nSimID, bool nFlag);
  7511. uint8_t CFW_SmsGetSmsType(CFW_SIM_ID nSimID);
  7512. uint32_t CFW_SwitchPort(uint8_t nFlag);
  7513. #ifdef __cplusplus
  7514. }
  7515. #endif
  7516. #define SIM_STATE_IDLE 0
  7517. #define SIM_STATE_TPDUCMD 1
  7518. #define SIM_STATE_CHANNEL 2
  7519. #define SIM_STATE_SELECT_APP 3
  7520. #define SIM_STATE_STATUS 4
  7521. #define SIM_MAX_TPDU_LEN 512
  7522. typedef struct CFW_SIM_TPDU
  7523. {
  7524. uint8_t nTPDU[SIM_MAX_TPDU_LEN];
  7525. uint8_t nChannel;
  7526. uint16_t nLength;
  7527. uint8_t nStatus;
  7528. } CFW_SIM_TPDU;
  7529. uint32_t CFW_SimTPDUCommand(uint8_t *TPDU, uint16_t Length, uint8_t Channel, uint16_t nUTI, CFW_SIM_ID nSimID);
  7530. #define OPEN_CHANNEL_CMD 0x00
  7531. #define CLOSE_CHANNEL_CMD 0x80
  7532. #define OPEN_CMD_LENGTH 0x01
  7533. #define CLOSE_CMD_LENGTH 0x00
  7534. typedef struct CFW_SIM_CHANNEL
  7535. {
  7536. uint8_t nCommand;
  7537. uint8_t nChannel;
  7538. uint8_t nStatus;
  7539. } CFW_SIM_CHANNEL;
  7540. uint32_t CFW_SimManageChannel(uint8_t command, uint8_t channel, uint16_t nUIT, CFW_SIM_ID nSimID);
  7541. typedef struct CFW_SIM_SELECT_APP
  7542. {
  7543. uint8_t aid[16];
  7544. uint8_t length;
  7545. uint8_t channel;
  7546. uint8_t nStatus;
  7547. } CFW_SIM_SELECT_APP;
  7548. uint32_t CFW_SimSelectApplication(uint8_t *aid, uint8_t length, uint8_t channel, uint16_t nUIT, CFW_SIM_ID nSimID);
  7549. uint32_t CFW_SimTPDUCommand(uint8_t *TPDU, uint16_t length, uint8_t channel, uint16_t nUTI, CFW_SIM_ID nSimID);
  7550. uint32_t CFW_GetRFTemperature(uint32_t *temp);
  7551. uint32_t CFW_SetLTEFreqPwrRange(uint16_t freqlow, uint16_t freqhigh, uint16_t power);
  7552. uint32_t CFW_GetLTEFreqPwrValue(uint32_t freq);
  7553. uint32_t CFW_SetRFFreqPwrRange(uint16_t mode, uint16_t band, uint16_t powerlow, uint16_t powerhigh);
  7554. uint32_t CFW_GetRFFreqPwrRange(uint16_t mode, uint16_t band, uint16_t *powerlow, uint16_t *powerhigh);
  7555. uint32_t CFW_SetSimFileUpdateCountMode(uint8_t op_mode, CFW_SIM_ID nSimID);
  7556. uint16_t CFW_GetSimFileUpdateCount(uint8_t nFileID, uint8_t bReal, CFW_SIM_ID nSimID);
  7557. uint32_t CFW_SetStaticScene(uint8_t iScene, CFW_SIM_ID nSimID);
  7558. uint32_t CFW_GetStaticScene(uint8_t *iScene, CFW_SIM_ID nSimID);
  7559. uint32_t CFW_SetRatePriority(uint8_t iPriority, CFW_SIM_ID nSimID);
  7560. uint32_t CFW_GetRatePriority(uint8_t *iPriority, CFW_SIM_ID nSimID);
  7561. typedef struct _CFW_APNS_UNAME_UPWD
  7562. {
  7563. char apn[THE_APN_MAX_LEN];
  7564. char username[THE_APN_USER_MAX_LEN];
  7565. char password[THE_APN_PWD_MAX_LEN];
  7566. } CFW_APNS_UNAME_UPWD;
  7567. typedef struct
  7568. {
  7569. uint8_t nTimeValue;
  7570. uint8_t nMaxCount;
  7571. } CFW_PDN_TIMER_MAXCOUNT_INFO;
  7572. uint32_t CFW_SetPdnActTimerAndMaxCount(CFW_PDN_TIMER_MAXCOUNT_INFO pdnTimerAndMaxCount, uint8_t nRat, CFW_SIM_ID nSimID);
  7573. uint32_t CFW_GetPdnActTimerAndMaxCount(CFW_PDN_TIMER_MAXCOUNT_INFO *pdnTimerAndMaxCount, uint8_t nRat, CFW_SIM_ID nSimID);
  7574. uint32_t CFW_SetPdnDeactTimerAndMaxCount(CFW_PDN_TIMER_MAXCOUNT_INFO pdnTimerAndMaxCount, uint8_t nRat, CFW_SIM_ID nSimID);
  7575. uint32_t CFW_GetPdnDeactTimerAndMaxCount(CFW_PDN_TIMER_MAXCOUNT_INFO *pdnTimerAndMaxCount, uint8_t nRat, CFW_SIM_ID nSimID);
  7576. uint32_t CFW_SetCSPagingFlag(bool nFlag, CFW_SIM_ID nSimID);
  7577. uint32_t CFW_GetCSPagingFlag(uint8_t *nFlag, CFW_SIM_ID nSimID);
  7578. extern uint32_t CSW_SetAndGetMicGain(uint8_t *resultcode, uint8_t *hasMsg, uint8_t *resultMsg, uint8_t mode, uint8_t nPath, uint8_t nCtrl, uint8_t *nParam, uint16_t nParamLength);
  7579. // Application Id that resides on the UICC see TS 31.110 for coding
  7580. typedef struct CFW_UsimAidTag
  7581. {
  7582. uint8_t data[16]; // AID value
  7583. uint8_t length; // AID length
  7584. } CFW_UsimAid;
  7585. typedef struct _NETWORK_REJECTION
  7586. {
  7587. uint8_t tag; //LOCATION_INFO_TAG location information
  7588. //ROUTING_AREA_ID_TAG Routing area identification
  7589. //TRACKING_AREA_ID_TAG Tracking area identification
  7590. uint8_t MNCaMCC[3];
  7591. uint8_t LACoTAC[2];
  7592. uint8_t RAC;
  7593. uint8_t CELL[4];
  7594. uint8_t access; //0 GSM, 03 UTRACE(3G), 08 E-UTRAN(4G)
  7595. uint8_t type; //update, attach, rejection
  7596. uint8_t code; //rejection code
  7597. uint8_t extend_code; // exended rejection code
  7598. } NETWORK_REJECTION;
  7599. typedef struct _CFW_SAT_SETUP_IDLE_RSP
  7600. {
  7601. uint8_t nComID;
  7602. uint8_t nComQualifier;
  7603. uint8_t nIdleTextLen;
  7604. uint8_t nIdleTextSch;
  7605. uint8_t *pIdleTextString;
  7606. uint8_t nIconQualifier;
  7607. uint8_t nIconIdentifier;
  7608. uint8_t nTextAttrLength;
  7609. uint8_t nFrameIdentifier;
  7610. uint8_t *pTextAttribute;
  7611. } CFW_SAT_SETUP_IDLE_RSP;
  7612. uint32_t CFW_SimWakeup(uint16_t nUTI, CFW_SIM_ID nSimID, bool flag);
  7613. uint32_t CFW_SimCloseEx(uint16_t nUTI, CFW_SIM_ID nSimID, bool flag);
  7614. uint32_t SimPollReq(uint8_t nTimerOut, CFW_SIM_ID nSimID);
  7615. uint32_t SimPollOffReq(CFW_SIM_ID nSimID);
  7616. uint32_t CFW_SimInitStage1(CFW_SIM_ID nSimID);
  7617. uint32_t CFW_SimInitStage3(CFW_SIM_ID nSimID);
  7618. //#if ((defined CONFIG_SOC_6760) || (defined CONFIG_SOC_8811))
  7619. //uint32_t CFW_SimGetMeProfile(CFW_PROFILE **pMeProfile, CFW_SIM_ID nSimID);
  7620. //#else
  7621. uint32_t CFW_SimGetMeProfile(CFW_PROFILE *pMeProfile, CFW_SIM_ID nSimID);
  7622. //#endif
  7623. uint32_t SimSelectApplicationReq(uint8_t *AID, uint8_t AIDLength, CFW_SIM_ID nSimID);
  7624. uint32_t SimSelectApplicationReqV2(uint8_t *AID, uint8_t AIDLength, uint8_t ChannelID, CFW_SIM_ID nSimID);
  7625. uint32_t CFW_SimTPDUCommand(uint8_t *TPDU, uint16_t Length, uint8_t Channel, uint16_t nUTI, CFW_SIM_ID nSimID);
  7626. uint32_t CFW_SmsSendMessage(CFW_DIALNUMBER *pNumber, uint8_t *pData, uint16_t nDataSize, uint16_t nUTI, CFW_SIM_ID nSimId);
  7627. void CFW_InvalideTmsiPTmis(CFW_SIM_ID nSimID);
  7628. void CFW_GetUsimAID(uint8_t *aid, uint8_t *length, CFW_SIM_ID nSimID);
  7629. bool CFW_SatGetCurrentCmd(uint8_t *nCmd, uint8_t *nQualifier, CFW_SIM_ID nSimID);
  7630. uint8_t CFW_SatGetSetupEventList(uint8_t *pEventList, uint8_t *pNum, CFW_SIM_ID nSimID);
  7631. void CFW_SatSetEventList(uint32_t nEventList, CFW_SIM_ID nSimID);
  7632. uint32_t CFW_SatGetEventList(CFW_SIM_ID nSimID);
  7633. bool CFW_GetSATIndFormate(void);
  7634. bool CFW_SatGetSendSmsData(uint8_t *pPduData, uint8_t *pDataLen, CFW_SIM_ID nSimID);
  7635. bool CFW_SatGetSendSmsSCInfo(uint8_t *pSCAddress, uint8_t *pSCLen, uint8_t *pType, CFW_SIM_ID nSimID);
  7636. bool CFW_SatGetRefreshFilesList(uint8_t *pFilesList, uint8_t *pFileNum, CFW_SIM_ID nSimID);
  7637. uint32_t CFW_SimRefreshFiles(uint8_t *pFiles, uint8_t nFileNum, uint16_t nUTI, CFW_SIM_ID nSimID);
  7638. bool CFW_SimGetLanguage(uint8_t *pLanguage, uint8_t *pNum, CFW_SIM_ID nSimID);
  7639. bool CFW_SatGetSetupIdleModeText(uint8_t *pText, uint8_t *pLength, uint8_t *pScheme, CFW_SIM_ID nSimID);
  7640. bool CFW_SatGetPlayToneText(uint8_t *pText, uint8_t *pLength, CFW_SIM_ID nSimID);
  7641. bool CFW_SatGetPlayToneDuration(uint8_t *pTone, uint8_t *pUnit, uint8_t *pInterval, CFW_SIM_ID nSimID);
  7642. bool CFW_SatGetPollIntervalDuration(uint8_t *pUnit, uint8_t *pInterval, CFW_SIM_ID nSimID);
  7643. bool CFW_SatGetTimerManagement(uint8_t *pTimerID, uint8_t *pHour, uint8_t *pMinute, uint8_t *pSecond, CFW_SIM_ID nSimID);
  7644. bool CFW_SatGetReceiveData(uint8_t *pChannelDataLength, CFW_SIM_ID nSimID);
  7645. bool CFW_SatGetSendData(uint8_t *pData, uint8_t *pDataLength, CFW_SIM_ID nSimID);
  7646. bool CFW_SatGetOpenChannelUserInfo(uint8_t *pUser, uint8_t *pUserLen, uint8_t *pPasswd, uint8_t *pPasswdLen, CFW_SIM_ID nSimID);
  7647. bool CFW_SatGetOpenChannelAPN(uint8_t *pAPN, uint8_t *pApnLen, CFW_SIM_ID nSimID);
  7648. bool CFW_SatGetOpenChannelDestAddress(uint8_t *pAddress, uint8_t *pAddressLen, uint8_t *pAddressType, CFW_SIM_ID nSimID);
  7649. bool CFW_SatGetOpenChannelNetInfoV2(uint16_t *pBufferSize, uint8_t *pBearerType, uint8_t *pTranType, uint16_t *pTranPort, CFW_SIM_ID nSimID);
  7650. bool CFW_SatGetOpenChannelNetInfo(uint8_t *pBufferSize, uint8_t *pBearerType, uint8_t *pTranType, uint8_t *pTranPort, CFW_SIM_ID nSimID);
  7651. bool CFW_SatGetDisplayText(uint8_t *pText, uint8_t *pTextLength, uint8_t *nScheme, CFW_SIM_ID nSimID);
  7652. uint32_t CFW_SimGetEID(uint16_t nUTI, CFW_SIM_ID nSimID);
  7653. uint32_t CFW_GprsHostAddress(uint8_t *pIPAddress, uint8_t *nLength, uint8_t *nIPType, uint8_t nCid, CFW_SIM_ID nSimID);
  7654. uint32_t SimSendStatusReq(uint8_t nMode, CFW_SIM_ID nSimID);
  7655. #define CFW_MAX_IMSI_ARR_LEN 8
  7656. #ifdef CONFIG_QUEC_PROJECT_FEATURE
  7657. //CID 4287051,4287049,:
  7658. //该宏在atSimlockGetNetworkLocks, atSimlockGetNetworkSubsetLocks, atSimlockGetSPLocks, atSimlockGetCorporateLocks, atSimlockGetUserLocks 中使用.
  7659. //可能会导致pSimLockData->user_locks.locks[i]越界,需要修改为NETWORK_LOCKS_T结构体中locks成员数组的大小.
  7660. #define CFW_MAX_PERSONALISATIONS 3
  7661. #else
  7662. #define CFW_MAX_PERSONALISATIONS 10
  7663. #endif
  7664. typedef struct _CFW_SIM_LOCK_PLMN_T
  7665. {
  7666. uint16_t mcc;
  7667. uint16_t mnc;
  7668. uint16_t mnc_digit_num;
  7669. uint16_t pending;
  7670. } CFW_SIM_LOCK_PLMN_T;
  7671. typedef struct _CFW_NETWORK_LOCKS_T
  7672. {
  7673. uint8_t numLocks;
  7674. uint8_t reserved; // Byte alignment
  7675. uint8_t pending[2];
  7676. CFW_SIM_LOCK_PLMN_T locks[CFW_MAX_PERSONALISATIONS];
  7677. } CFW_NETWORK_LOCKS_T;
  7678. typedef struct _CFW_NETWORK_SUBSET_LOCK_DATA_T
  7679. {
  7680. CFW_SIM_LOCK_PLMN_T plmn;
  7681. uint8_t network_subset[2]; // IMSI digits 6 and 7
  7682. uint8_t pending[2];
  7683. } CFW_NETWORK_SUBSET_LOCK_DATA_T;
  7684. typedef struct _CFW_NETWORK_SUBSET_LOCKS_T
  7685. {
  7686. uint8_t numLocks;
  7687. uint8_t reserved; // Byte alignment
  7688. uint8_t pending[2];
  7689. CFW_NETWORK_SUBSET_LOCK_DATA_T locks[CFW_MAX_PERSONALISATIONS];
  7690. } CFW_NETWORK_SUBSET_LOCKS_T;
  7691. typedef struct _CFW_SP_LOCK_DATA_T
  7692. {
  7693. CFW_SIM_LOCK_PLMN_T plmn;
  7694. uint8_t sp; // GID1 1 byte
  7695. uint8_t reserved; // Byte alignment
  7696. uint8_t pending[2];
  7697. } CFW_SP_LOCK_DATA_T;
  7698. typedef struct _CFW_SP_LOCKS_T
  7699. {
  7700. uint8_t numLocks;
  7701. uint8_t reserved; // Byte alignment
  7702. uint8_t pending[2];
  7703. CFW_SP_LOCK_DATA_T locks[CFW_MAX_PERSONALISATIONS];
  7704. } CFW_SP_LOCKS_T;
  7705. typedef struct _CFW_CORPORATE_LOCK_DATA_T
  7706. {
  7707. CFW_SIM_LOCK_PLMN_T plmn;
  7708. uint8_t sp; // GID1 1 byte
  7709. uint8_t corporate; // GID2 1 byte
  7710. uint8_t pending[2];
  7711. } CFW_CORPORATE_LOCK_DATA_T;
  7712. typedef struct _CFW_CORPORATE_LOCKS_T
  7713. {
  7714. uint8_t numLocks;
  7715. uint8_t reserved; // Byte alignment
  7716. uint8_t pending[2];
  7717. CFW_CORPORATE_LOCK_DATA_T locks[CFW_MAX_PERSONALISATIONS];
  7718. } CFW_CORPORATE_LOCKS_T;
  7719. typedef struct _CFW_IMSI_T
  7720. {
  7721. uint8_t imsi_len;
  7722. uint8_t pending[3];
  7723. uint8_t imsi_val[CFW_MAX_IMSI_ARR_LEN];
  7724. } CFW_IMSI_T;
  7725. typedef CFW_IMSI_T CFW_USER_LOCK_DATA_T;
  7726. typedef struct _CFW_USER_LOCKS2_T
  7727. {
  7728. uint8_t numLocks;
  7729. uint8_t pending[3];
  7730. CFW_USER_LOCK_DATA_T locks[3];
  7731. } CFW_USER_LOCKS2_T;
  7732. typedef struct
  7733. {
  7734. uint32_t SIM_lock_status;
  7735. uint32_t max_num_trials;
  7736. CFW_NETWORK_LOCKS_T network_locks;
  7737. CFW_NETWORK_SUBSET_LOCKS_T network_subset_locks;
  7738. CFW_SP_LOCKS_T SP_locks;
  7739. CFW_CORPORATE_LOCKS_T corporate_locks;
  7740. CFW_USER_LOCKS2_T user_locks;
  7741. } CFW_SRV_SIMLOCKDATA_T;
  7742. bool Cfw_SetTimezone(int8_t timezone);
  7743. typedef struct T_RADIO_STATS_RPT_TAG
  7744. {
  7745. int16_t signal_power; //<signal power in centibels>
  7746. int16_t total_power; //<total power in centibels>
  7747. int16_t cur_TX_power; //<current TX power level in centibels >
  7748. uint64_t ttl_TX_time; //<total TX time since last reboot in millisecond>
  7749. uint64_t ttl_RX_time; //<total RX time since last reboot in millisecond>
  7750. uint32_t last_SIB1_cell_id; //<last SIB1 cell ID>, 0xffffffff is invalid, lsb 28bits are valid
  7751. uint8_t last_ECL_val; //<last ECL value>
  7752. int16_t last_snr_val; //<last snr value>
  7753. uint16_t last_earfcn; //<last earfcn value>
  7754. uint16_t last_pci_val; //<last pci value>
  7755. int16_t rsrq; //<rsrq in centibels>
  7756. uint8_t operator_mode; //<operator mode in MIB>
  7757. } CFW_UE_RADIO_STATS_RPT;
  7758. typedef struct T_CELL_STATS_RPT_TAG
  7759. {
  7760. uint16_t earfcn; //<earfcn> absolute radio-frequency channel number
  7761. uint16_t phy_cell_id; //<physical cell id> physical id of the cell
  7762. uint8_t pri_cell; //<primary cell> 1 indicates the current serving cell, 0xff is invalid
  7763. int16_t rsrp; //<rsrp> reference signal received power
  7764. int16_t rsrq; //<rsrq> reference signal received quality
  7765. int16_t rssi; //<rssi> received signal strength indicator, 0x7fff is invalid
  7766. int16_t snr; //<snr> signal to noise ratio, 0x7f is invalid
  7767. int8_t offset; /*NB-IoT channel number?篓陇??篓庐篓虏EARFCN娄士??篓掳??隆杞柯郝μ�??娄士D篓庐D-0.5隆杞縜篓垄?隆陇?隆锟铰¤娇???篓潞娄士娄食?2隆a?a隆饪★拷篓垄?娄士?娄士隆鑻� 篓篓??娄獭陇??隆膦÷�!3篓娄??篓潞娄士娄台潞隆锟铰癮3y篓掳?2隆杩¢瓖
  7768. -20,-18,-16,-14,-12,-10,-8,-6,-4,-2,-1,0,2,4,6,8,10,12,14,16,18?隆鑻� */
  7769. uint8_t band;
  7770. } CFW_UE_CELL_STATS_RPT;
  7771. typedef struct T_BLER_STATS_RPT_TAG
  7772. {
  7773. uint16_t rlc_ul_bler; //<rlc_ul_bler> RLC layer block error rate (uplink). permille
  7774. uint16_t rlc_dl_bler; //<rlc_dl_bler> RLC layer block error rate (downlink). permille
  7775. uint16_t mac_ul_bler; //<mac_ul_bler> physical layer block error rate (uplink). permille
  7776. uint16_t mac_dl_bler; //<mac_dl_bler> physical layer block error rate (downlink).permille
  7777. uint64_t ttl_bytes_tx; //<total bytes transmitted>
  7778. uint64_t ttl_bytes_rx; //<total bytes received>
  7779. uint32_t tb_num_tx; //<transport blocks sent>
  7780. uint32_t tb_num_rx; //<transport blocks received>
  7781. uint32_t tb_num_retx; //<transport blocks retransmitted>
  7782. uint32_t ttl_ack_nack_msg_rx; //<total ack/nack messages received>
  7783. } CFW_UE_BLER_STATS_RPT;
  7784. typedef struct T_UE_THROUPUT_STATS_RPT_TAG
  7785. {
  7786. uint32_t rlc_ul_bps; //<rlc_ul> RLC layer throughput (uplink). Integer bps
  7787. uint32_t rlc_dl_bps; //<rlc_dl> RLC layer throughput (downlink). Integer bps
  7788. uint32_t mac_ul_bps; //<mac_ul> physical layer throughput (uplink). Integer bps
  7789. uint32_t mac_dl_bps; //<mac_dl> physical layer throughput (downlink). Integer bps
  7790. } CFW_UE_THROUPUT_STATS_RPT;
  7791. #define CFW_MAX_CELL_STATS_RPT_NUM 5
  7792. typedef struct T_UE_STATS_RPT_TAG
  7793. {
  7794. uint8_t cellNum;
  7795. CFW_UE_RADIO_STATS_RPT radioStats;
  7796. CFW_UE_CELL_STATS_RPT cellStats[CFW_MAX_CELL_STATS_RPT_NUM];
  7797. CFW_UE_BLER_STATS_RPT blerStats;
  7798. CFW_UE_THROUPUT_STATS_RPT throughputStats;
  7799. } CFW_UE_STATS_RPT;
  7800. uint32_t CFW_SetPlmn(CFW_NV_PLMN nNvPlmn, CFW_SIM_ID nSimID);
  7801. uint32_t CFW_GetPlmn(CFW_NV_PLMN *nNvPlmn, CFW_SIM_ID nSimID);
  7802. uint32_t CFW_SmsListFree(void *pListResult, uint8_t nCount, uint8_t nIndex, CFW_SIM_ID nSimID);
  7803. uint16_t CFW_SetRauAfterCallFlag(uint16_t flag);
  7804. uint16_t CFW_GetRauAfterCallFlag();
  7805. uint32_t CFW_SetNvUpdateFlag(uint32_t nFlag, CFW_SIM_ID nSimID);
  7806. #define NV_NW_SIM_PLMN 0
  7807. #define NV_NW_SIM_BA_COUNT 1
  7808. #define NV_NW_SIM_BA_COUNT_PENDING 2
  7809. #define NV_NW_SIM_ARFCE_LIST 3
  7810. #define NV_NW_SIM_STORE_LAST 4
  7811. #define NV_SMS_SIM_PARAM_MR 5
  7812. #define NV_GPRS_SIM_DOWN_SUM 6
  7813. #define NV_GPRS_SIM_UP_SUM 7
  7814. uint32_t CFW_SetSignalQuatityFirst(uint32_t signalQuatityFirst, CFW_SIM_ID nSimID);
  7815. uint32_t CFW_GetSignalQuatityFirst(uint32_t *signalQuatityFirst, CFW_SIM_ID nSimID);
  7816. uint32_t CFW_EnableLpsLock(bool nEnable, CFW_SIM_ID nSimID);
  7817. #if defined RPM_SUPPORT && defined(CONFIG_SOC_8910)
  7818. uint8_t sdb_nvGetDefaultPdnSettingApn(uint8_t *outputApn, uint8_t simFlag);
  7819. bool sdb_rpmCheckAllowRebootingPdpActiving(uint8_t *apn, uint32_t apnLen, uint8_t trb, uint8_t addFx, uint32_t sim_index);
  7820. bool sdb_rpmAllowPdpActivating(uint8_t *apn, uint32_t apnLen, uint8_t trb, uint32_t sim_index);
  7821. uint8_t sdb_rpmGetRpmFlag(uint32_t sim_index);
  7822. void sdb_rpmSetRpmFlag(uint8_t rpmFlag, uint32_t sim_index);
  7823. void sdb_rpmWriteStatic(uint32_t sim_index);
  7824. void sdb_rpmWriteDynamic(uint32_t sim_index);
  7825. void sdb_rpmWriteDynamicEx(int32_t BeReBoot, uint32_t sim_index);
  7826. void sdb_rpmResetRpmFunction(uint32_t sim_index);
  7827. uint8_t sdb_rpmGetRpmN1(uint32_t sim_index);
  7828. void sdb_rpmSetRpmN1(uint8_t rpmN1, uint32_t sim_index);
  7829. uint8_t sdb_rpmGetRpmT1(uint32_t sim_index);
  7830. void sdb_rpmSetRpmT1(uint8_t rpmT1, uint32_t sim_index);
  7831. uint8_t sdb_rpmGetRpmFX(uint8_t fx, uint32_t sim_index);
  7832. void sdb_rpmSetRpmFX(uint8_t fx, uint8_t rpmValue, uint32_t sim_index);
  7833. uint8_t sdb_rpmGetRpmLRX(uint8_t lrx, uint32_t sim_index);
  7834. void sdb_rpmSetRpmLRX(uint8_t lrx, uint8_t rpmValue, uint32_t sim_index);
  7835. uint8_t sdb_rpmGetRpmCBR1(uint32_t sim_index);
  7836. uint8_t sdb_rpmGetRpmCR1(uint32_t sim_index);
  7837. void sdb_rpmSetRpmCR1(uint8_t value, uint32_t sim_index);
  7838. void sdb_rpmGetRpmCpdpx(uint8_t *apn, uint8_t apnLen, uint8_t *cpdp1, uint8_t *cpdp2, uint8_t *cpdp3, uint8_t *cpdp4, uint32_t sim_index);
  7839. uint32_t CFW_RpmNvGetDefaultPdnSettingApn(uint8_t *outputApn, uint8_t *outApnLen, CFW_SIM_ID nSimID);
  7840. uint32_t CFW_RpmCheckAllowRebootingPdpActiving(bool *outFlag, uint8_t *apn, uint32_t apnLen, uint8_t trb, uint8_t addFx, CFW_SIM_ID nSimID);
  7841. uint32_t CFW_RpmAllowPdpActivating(bool *outFlag, uint8_t *apn, uint32_t apnLen, uint8_t trb, CFW_SIM_ID nSimID);
  7842. uint32_t CFW_RpmGetRpmFlag(uint8_t *outFlag, CFW_SIM_ID nSimID);
  7843. uint32_t CFW_RpmSetRpmFlag(uint8_t rpmFlag, CFW_SIM_ID nSimID);
  7844. uint32_t CFW_RpmWriteStatic(CFW_SIM_ID nSimID);
  7845. uint32_t CFW_RpmWriteDynamic(CFW_SIM_ID nSimID);
  7846. uint32_t CFW_RpmWriteDynamicEx(int32_t BeReBoot, CFW_SIM_ID nSimID);
  7847. //only called while USIM changed or AT configuration updated
  7848. uint32_t CFW_RpmResetRpmFunction(CFW_SIM_ID nSimID);
  7849. uint32_t CFW_RpmGetRpmN1(uint8_t *rpmN1, CFW_SIM_ID nSimID);
  7850. uint32_t CFW_RpmSetRpmN1(uint8_t rpmN1, CFW_SIM_ID nSimID);
  7851. uint32_t CFW_RpmGetRpmT1(uint8_t *rpmT1, CFW_SIM_ID nSimID);
  7852. uint32_t CFW_RpmSetRpmT1(uint8_t rpmT1, CFW_SIM_ID nSimID);
  7853. uint32_t CFW_RpmGetRpmFx(uint8_t *rpmFx, uint8_t fx, CFW_SIM_ID nSimID);
  7854. uint32_t CFW_RpmSetRpmFx(uint8_t fx, uint8_t rpmValue, CFW_SIM_ID nSimID);
  7855. uint32_t CFW_RpmGetRpmLRX(uint8_t *rpmLRX, uint8_t lrx, CFW_SIM_ID nSimID);
  7856. uint32_t CFW_RpmSetRpmLRX(uint8_t lrx, uint8_t rpmValue, CFW_SIM_ID nSimID);
  7857. uint32_t CFW_RpmGetRpmCBR1(uint8_t *rpmCBR1, CFW_SIM_ID nSimID);
  7858. uint32_t CFW_RpmGetRpmCR1(uint8_t *rpmCR1, CFW_SIM_ID nSimID);
  7859. uint32_t CFW_RpmSetRpmCR1(uint8_t value, CFW_SIM_ID nSimID);
  7860. uint32_t CFW_RpmGetRpmCpdpx(uint8_t *apn, uint8_t apnLen, uint8_t *cpdp1, uint8_t *cpdp2, uint8_t *cpdp3, uint8_t *cpdp4, CFW_SIM_ID nSimID);
  7861. uint32_t CFW_rpmNvGetLastRat(uint8_t *nLastRat, CFW_SIM_ID nSimId);
  7862. uint32_t CFW_rpmNvSetLastRat(uint8_t rat, CFW_SIM_ID nSimId);
  7863. #endif
  7864. typedef enum
  7865. {
  7866. CSCLK_NO_PM = 0,
  7867. CSCLK_CHECK_DTR = 1,
  7868. CSCLK_PM1 = 2,
  7869. CSCLK_PM2 = 5,
  7870. CSCLK_PM3 = 9,
  7871. CSCLK_INVALID = 0x7fffffff
  7872. } CSCLK_PM_ENUM;
  7873. uint32_t CFW_EmodSetPowerMode(CSCLK_PM_ENUM nValue, CFW_SIM_ID nSimID);
  7874. #if 1 //NBIOT_POSITION_SUPPORT
  7875. typedef struct
  7876. {
  7877. uint16_t bearing;
  7878. uint16_t horizontal_speed;
  7879. } T_Horizontal_Velocity;
  7880. typedef struct
  7881. {
  7882. uint8_t d;
  7883. uint8_t vertical_speed;
  7884. uint16_t bearing;
  7885. uint16_t horizontal_speed;
  7886. } T_Horizontal_With_Vertical_Velocity;
  7887. typedef struct
  7888. {
  7889. uint8_t uncertainty_speed;
  7890. uint16_t bearing;
  7891. uint16_t horizontal_speed;
  7892. } T_Horizontal_Velocity_With_Uncertainty;
  7893. typedef struct
  7894. {
  7895. uint8_t d;
  7896. uint8_t vertical_speed;
  7897. uint8_t horizontal_uncertainty_speed;
  7898. uint8_t vertical_uncertainty_speed;
  7899. uint16_t bearing;
  7900. uint16_t horizontal_speed;
  7901. } T_Horizontal_With_Vertical_Velocity_Uncertainty;
  7902. typedef struct
  7903. {
  7904. uint8_t velocity_type;
  7905. union {
  7906. T_Horizontal_Velocity vel0;
  7907. T_Horizontal_With_Vertical_Velocity vel1;
  7908. T_Horizontal_Velocity_With_Uncertainty vel2;
  7909. T_Horizontal_With_Vertical_Velocity_Uncertainty vel3;
  7910. } u;
  7911. } T_CFW_Lcs_Molr_Vel_Res;
  7912. typedef struct
  7913. {
  7914. uint8_t sign_of_latitue;
  7915. uint32_t degrees_of_latitue;
  7916. uint32_t degrees_of_longtitue;
  7917. } T_Ellipsoid_Basic_Shape;
  7918. typedef T_Ellipsoid_Basic_Shape T_Ellipsoid_Point;
  7919. typedef struct
  7920. {
  7921. T_Ellipsoid_Basic_Shape basic_shape;
  7922. uint8_t uncertainty_code;
  7923. } T_Ellipsoid_Point_With_Uncert_Circle;
  7924. typedef struct
  7925. {
  7926. T_Ellipsoid_Basic_Shape basic_shape;
  7927. uint8_t uncertainty_semi_major;
  7928. uint8_t uncertainty_semi_minor;
  7929. uint8_t orientation_of_major_axis;
  7930. uint8_t confidence;
  7931. } T_Ellipsoid_Point_With_Uncert_Ellipse;
  7932. typedef struct
  7933. {
  7934. T_Ellipsoid_Basic_Shape basic_shape[15];
  7935. } T_Polygon;
  7936. typedef struct
  7937. {
  7938. T_Ellipsoid_Basic_Shape basic_shape;
  7939. uint8_t d;
  7940. uint16_t altitude;
  7941. } T_Ellipsoid_Point_With_Altitude;
  7942. typedef struct
  7943. {
  7944. T_Ellipsoid_Basic_Shape basic_shape;
  7945. uint8_t d;
  7946. uint16_t altitude;
  7947. uint8_t uncertainty_semi_major;
  7948. uint8_t uncertainty_semi_minor;
  7949. uint8_t orientation_of_major_axis;
  7950. uint8_t uncertainty_altitude;
  7951. uint8_t confidence;
  7952. } T_Ellipsoid_Point_With_Alti_Uncert_Ellipse;
  7953. typedef struct
  7954. {
  7955. T_Ellipsoid_Basic_Shape basic_shape;
  7956. uint16_t inner_radius;
  7957. uint8_t uncertainty_radius;
  7958. uint8_t offset_angle;
  7959. uint8_t included_angle;
  7960. uint8_t confidence;
  7961. } T_Ellipsoid_Arc;
  7962. typedef struct
  7963. {
  7964. uint8_t type_of_shape;
  7965. uint8_t polygon_num_of_points;
  7966. union {
  7967. T_Ellipsoid_Point shape0;
  7968. T_Ellipsoid_Point_With_Uncert_Circle shape1;
  7969. T_Ellipsoid_Point_With_Uncert_Ellipse shape3;
  7970. T_Polygon shape5;
  7971. T_Ellipsoid_Point_With_Altitude shape8;
  7972. T_Ellipsoid_Point_With_Alti_Uncert_Ellipse shape9;
  7973. T_Ellipsoid_Arc shape10;
  7974. } u;
  7975. } T_CFW_Lcs_Molr_Loc_Res;
  7976. typedef struct
  7977. {
  7978. } T_CFW_Lcs_Molr_Addloc_Res;
  7979. typedef struct
  7980. {
  7981. uint8_t bit_mask;
  7982. union {
  7983. T_CFW_Lcs_Molr_Loc_Res loc;
  7984. T_CFW_Lcs_Molr_Addloc_Res addLoc;
  7985. } u;
  7986. T_CFW_Lcs_Molr_Vel_Res vel_res;
  7987. } T_CFW_Lcs_Molr_Res;
  7988. typedef struct
  7989. {
  7990. uint8_t nIndex;
  7991. void *pMsg;
  7992. T_CFW_Lcs_Molr_Res MolrRes;
  7993. } CFW_SS_LCS_INFO;
  7994. typedef struct _CFW_LCS_MTLR_INFO
  7995. {
  7996. uint8_t handle_id;
  7997. uint8_t notification_type;
  7998. uint8_t location_type;
  7999. bool clientExternalIdPresent;
  8000. uint8_t clientExternalId[9];
  8001. bool clientNamePresent;
  8002. uint8_t clientName[63];
  8003. } CFW_LCS_MTLR_INFO;
  8004. typedef struct _CFW_LCS_MOLR_INFO
  8005. {
  8006. uint8_t method;
  8007. uint8_t hor_acc_set;
  8008. uint8_t hor_acc;
  8009. uint8_t ver_req;
  8010. uint8_t ver_acc_set;
  8011. uint8_t ver_acc;
  8012. uint8_t vel_req;
  8013. uint8_t rep_mode;
  8014. uint8_t interval;
  8015. uint8_t shape_rep;
  8016. uint8_t plane;
  8017. uint16_t timeout;
  8018. uint8_t nmea_rep[100];
  8019. uint8_t third_party_address[100];
  8020. } CFW_LCS_MOLR_INFO;
  8021. uint32_t CFW_LcsMtlrRsp(uint8_t handle_id, uint8_t response, uint16_t nUTI, CFW_SIM_ID nSimID);
  8022. uint32_t CFW_LcsMolrReq(CFW_LCS_MOLR_INFO *molrInfo, uint16_t nUTI, CFW_SIM_ID nSimID);
  8023. #endif
  8024. #define CFW_AUTO_ACT_LTE_CID 5
  8025. bool CFW_UpdateNV(bool bForce);
  8026. bool CFW_SatGetOpenChannelBearerDes(CFW_GPRS_QOS *Qos, uint8_t *pdp_type, CFW_SIM_ID nSimID);
  8027. bool CFW_SatGetChannelID(uint8_t *channel, CFW_SIM_ID nSimID);
  8028. typedef struct _CFW_SUSP_FUNC_SELECT
  8029. {
  8030. uint8_t nMaxDurTimeUnit;
  8031. uint8_t nMaxDurLenOfTime;
  8032. uint8_t nMinDurTimeUnit;
  8033. uint8_t nMinDurLenOfTime;
  8034. } CFW_SUSP_FUNC_SELECT;
  8035. uint32_t CFW_SimSetResume(uint8_t *nResumeToken, uint16_t nUTI, CFW_SIM_ID nSimID);
  8036. uint32_t CFW_SimSetSuspend(CFW_SUSP_FUNC_SELECT *pSelParam, uint16_t nUTI, CFW_SIM_ID nSimID);
  8037. uint32_t CFW_nvSetCopsTimer(uint8_t nValue);
  8038. uint32_t CFW_nvGetCopsTimer(void);
  8039. #ifdef CONFIG_SOC_8811
  8040. uint32_t CFW_AutoGprsAct(CFW_SIM_ID nSim, uint8_t uCid_set);
  8041. #endif
  8042. #ifndef CONFIG_SOC_8811
  8043. /*! \brief function retrieves the loss Cover Timer value.
  8044. \return \a loss Cover Timer value
  8045. */
  8046. uint32_t CFW_GetLCTimer(void);
  8047. /*! \brief function set the loss Cover Timere value.
  8048. \param [in] value loss Cover Timer value.
  8049. \return \a ERR_SUCCESS on success
  8050. */
  8051. uint32_t CFW_SetLCTimer(
  8052. uint32_t value);
  8053. /*! \brief function retrieves the loss Cover Timer value.
  8054. \return \a loss Cover Timer value
  8055. */
  8056. uint32_t CFW_GetLCTimerEx(
  8057. CFW_SIM_ID nSimID);
  8058. /*! \brief function set the loss Cover Timere value.
  8059. \param [in] value loss Cover Timer value.
  8060. \return \a ERR_SUCCESS on success
  8061. */
  8062. uint32_t CFW_SetLCTimerEx(
  8063. uint32_t value,
  8064. CFW_SIM_ID nSimID);
  8065. /*! \brief function retrieves the limite timer value.
  8066. \return \a limite timer value
  8067. */
  8068. uint32_t CFW_GetLimiteTimer(
  8069. CFW_SIM_ID nSimID);
  8070. /*! \brief function set the limite timer value.
  8071. \param [in] value limite timer value.
  8072. \return \a ERR_SUCCESS on success
  8073. */
  8074. uint32_t CFW_SetLimiteTimer(
  8075. uint32_t value,
  8076. CFW_SIM_ID nSimID);
  8077. /*! \brief function retrieves the lossCoverTiParam loopCout value.
  8078. \return \a lossCoverTiParam loopCout value
  8079. */
  8080. uint32_t CFW_GetLctLoopCout(
  8081. CFW_SIM_ID nSimID);
  8082. /*! \brief function set the lossCoverTiParam loopCout value.
  8083. \param [in] value lossCoverTiParam loopCout value.
  8084. \return \a ERR_SUCCESS on success
  8085. */
  8086. uint32_t CFW_SetLctLoopCout(
  8087. uint32_t value,
  8088. CFW_SIM_ID nSimID);
  8089. /*! \brief function retrieves the limitedTiParam loopCout value.
  8090. \return \a limitedTiParam loopCout value
  8091. */
  8092. uint32_t CFW_GetLmtLoopCout(
  8093. CFW_SIM_ID nSimID);
  8094. /*! \brief function set the limitedTiParam loopCout value.
  8095. \param [in] value limitedTiParam loopCout value.
  8096. \return \a ERR_SUCCESS on success
  8097. */
  8098. uint32_t CFW_SetLmtLoopCout(
  8099. uint32_t value,
  8100. CFW_SIM_ID nSimID);
  8101. /*! \brief function retrieves the lossCoverTiParam maxLen value.
  8102. \return \a lossCoverTiParam maxLen value
  8103. */
  8104. uint32_t CFW_GetLctMaxLen(
  8105. CFW_SIM_ID nSimID);
  8106. /*! \brief function set the lossCoverTiParam maxLen value.
  8107. \param [in] value lossCoverTiParam maxLen value.
  8108. \return \a ERR_SUCCESS on success
  8109. */
  8110. uint32_t CFW_SetLctMaxLen(
  8111. uint32_t value,
  8112. CFW_SIM_ID nSimID);
  8113. /*! \brief function retrieves the limitedTiParam maxLen value.
  8114. \return \a limitedTiParam maxLen value
  8115. */
  8116. uint32_t CFW_GetLmtMaxLen(
  8117. CFW_SIM_ID nSimID);
  8118. uint32_t CFW_NwSetNetTAU(
  8119. CFW_SIM_ID nSimID);
  8120. /*! \brief function set the limitedTiParam maxLen value.
  8121. \param [in] value limitedTiParam maxLen value.
  8122. \return \a ERR_SUCCESS on success
  8123. */
  8124. uint32_t CFW_SetLmtMaxLen(
  8125. uint32_t value,
  8126. CFW_SIM_ID nSimID);
  8127. #endif
  8128. uint8_t CFW_GprsGetNsapi(uint8_t nCid, CFW_SIM_ID nSimID);
  8129. #ifdef CONFIG_AT_CUS_SUPPORT
  8130. uint32_t CFW_CfgGcSetSMS(CFW_COMM_MODE bMode, CFW_SIM_ID nSimID);
  8131. uint32_t CFW_CfgGcGetSMS(CFW_COMM_MODE *bMode, CFW_SIM_ID nSimID);
  8132. uint32_t CFW_CfgGcSetBip(CFW_COMM_MODE bMode, CFW_SIM_ID nSimID);
  8133. uint32_t CFW_CfgGcGetBip(CFW_COMM_MODE *bMode, CFW_SIM_ID nSimID);
  8134. #endif
  8135. //arbitration module
  8136. typedef struct _CFW_WIFISCAN_AP_RESULT
  8137. {
  8138. uint32_t bssid_low; ///< mac address low
  8139. uint16_t bssid_high; ///< mac address high
  8140. uint8_t channel; ///< channel id
  8141. int8_t rssival; ///< signal strength
  8142. uint16_t reserved;
  8143. uint16_t ssidlen; // ssid len, unit byte
  8144. uint8_t ssid[32];
  8145. } CFW_WIFISCAN_AP_RESULT;
  8146. typedef struct _CFW_WIFISCAN_INFO
  8147. {
  8148. uint16_t eventCount;
  8149. uint16_t finished;
  8150. uint16_t wifiApNum; //number of AP(s) that have been scanned.
  8151. uint16_t maxApNum;
  8152. CFW_WIFISCAN_AP_RESULT *wifiScanResult;
  8153. } CFW_WIFISCAN_INFO;
  8154. typedef struct _CFW_WIFISCAN_REQ
  8155. {
  8156. bool wswitch; //start or stop wifiscan
  8157. uint16_t nChNum; // number of channels scanned
  8158. uint16_t nMaxNodeNum; //maximum number of scan
  8159. uint16_t nCh[13]; //channel id (1-13)
  8160. } CFW_WIFISCAN_REQ;
  8161. /**
  8162. * @brief wifiscan start api, wifi will be automatically turned off after scanning.
  8163. *
  8164. * @param wifiscan_param: struct from CFW_WIFISCAN_REQ.
  8165. * @param nUTI: UTI operation.
  8166. * @param nSim: sim index.
  8167. *
  8168. * @return 1 success, others: fail
  8169. */
  8170. uint32_t CFW_WifiScanStart(CFW_WIFISCAN_REQ wifiscan_param, uint16_t nUTI, CFW_SIM_ID nSimID);
  8171. /**
  8172. * @brief wifiscan stop api.
  8173. *
  8174. * @param nUTI: UTI operation.
  8175. * @param nSim: sim index.
  8176. *
  8177. * @return 1 success, others: fail
  8178. */
  8179. uint32_t CFW_WifiScanStop(uint16_t nUTI, CFW_SIM_ID nSimID);
  8180. /**
  8181. * @brief Interface for handshaking with LTE,
  8182. * When satrting GNSS service,
  8183. * LTE needs to be notified with this interface.
  8184. *
  8185. * @param nServiceType: 0 hot gnss service, 1 cold gnss service
  8186. * @param nUTI: UTI operation.
  8187. * @param nSim: sim index.
  8188. *
  8189. * @return 1 success, others: fail
  8190. */
  8191. uint32_t CFW_GnssStartHandshakeStack(uint8_t nServiceType, uint16_t nUTI, CFW_SIM_ID nSimID);
  8192. /**
  8193. * @brief Interface for handshaking with LTE,
  8194. * When stoping GNSS service,
  8195. * LTE needs to be notified with this interface.
  8196. *
  8197. * @param nUTI: UTI operation.
  8198. * @param nSim: sim index.
  8199. *
  8200. * @return 1 success, others: fail
  8201. */
  8202. uint32_t CFW_GnssStopHandshakeStack(uint16_t nUTI, CFW_SIM_ID nSimID);
  8203. /**
  8204. * @brief When the WiFi scan is completed,
  8205. * this function is used to obtain the scan result.
  8206. * Each AP contains a set of scan result.
  8207. * Be sure to use this function to obtain the scan results.
  8208. * Memory leakage will occur on the no side.(This function
  8209. * will release the memory occupied by the scan results)
  8210. *
  8211. * @param listAddr: The first address whrer the scan results are stored.
  8212. * @param index: Number of AP(s) scanned.
  8213. * @param end: Identify whether it is the last AP, 1 yes, 0 no.
  8214. * @param scan_result: Hotspot information contained in an AP.
  8215. *
  8216. * @return 1 listAddr is null, 0: get AP information
  8217. */
  8218. uint32_t CFW_LocGetWifiscanRes(void *listAddr, uint8_t index, uint8_t end, CFW_WIFISCAN_AP_RESULT *scan_result);
  8219. /**
  8220. * @brief Set GNSS and LTE service priority.
  8221. * After setting, you need to restart to take effect.
  8222. *
  8223. * @param locPriority:
  8224. * 0: gnss cold > lte signal > gnss hot > lte data
  8225. * 1: gnss cold > lte signal > lte data > gnss hot
  8226. * 2: gnss cold > gnss hot > lte signal > lte data
  8227. * 3: lte signal > lte data > gnss cold > gnss hot
  8228. * @param nSim: sim index.
  8229. *
  8230. * @return 1 success, others: fail
  8231. */
  8232. void CFW_nvSetLocPriority(uint8_t locPriority, CFW_SIM_ID nSimID);
  8233. /**
  8234. * @brief Set GNSS and LTE service priority.
  8235. * During setting, it's required to ensure that GNSS is off.
  8236. *
  8237. * @param locPriority:
  8238. * 0: gnss cold > lte signal > gnss hot > lte data
  8239. * 1: gnss cold > lte signal > lte data > gnss hot
  8240. * 2: gnss cold > gnss hot > lte signal > lte data
  8241. * 3: lte signal > lte data > gnss cold > gnss hot
  8242. * @param nSim: sim index.
  8243. *
  8244. * @return 1 success, others: fail
  8245. */
  8246. uint32_t CFW_nvSetLocPriority_V2(uint8_t locPriority, uint16_t nTUI, CFW_SIM_ID nSimID);
  8247. /**
  8248. * @brief Get GNSS and LTE service priority.
  8249. *
  8250. * @param nSim: sim index.
  8251. *
  8252. * @return GNSS and LTE service Priority value.
  8253. */
  8254. uint8_t CFW_nvGetLocPriority(CFW_SIM_ID nSimID);
  8255. //wifi sensitivity test
  8256. #define AT_WIFI_SENTEST_MAX_CNT 10
  8257. typedef struct _CFW_WIFISENTEST_RES
  8258. {
  8259. uint8_t mode; //0: signle mod 1:con mod
  8260. uint8_t ch_id; // channel no
  8261. uint16_t loop_cnt; // for con mod, executed loop cnt
  8262. uint16_t max_loop; // for con mod, max loop cnt
  8263. uint16_t result[AT_WIFI_SENTEST_MAX_CNT]; // test result (beacon frame counter), for single mod, the result fixed in u16_result[0]
  8264. uint16_t resvered;
  8265. } CFW_WIFISENTEST_RES;
  8266. typedef struct _CFW_WIFISENTEST_PARAM
  8267. {
  8268. uint8_t mode; //0: signle mod 1:con mod
  8269. uint8_t ch_id; // channel no
  8270. uint16_t loop_time; //unit ms, one loop duration
  8271. uint16_t max_loop; //max loop cnt
  8272. uint16_t resvered;
  8273. } CFW_WIFISENTEST_PARAM;
  8274. void CFW_WifiSentestOn(void);
  8275. void CFW_WifiSentestOff(void);
  8276. uint32_t CFW_WifiSentestSetParam(CFW_WIFISENTEST_PARAM *sentest_cfg);
  8277. uint32_t CFW_WifiSentestGetSingleRes(CFW_WIFISENTEST_RES *sentest_res);
  8278. uint32_t CFW_nvSetNasTimer(uint8_t nType, uint8_t nName, uint16_t nValue, CFW_SIM_ID nSimID);
  8279. uint32_t CFW_nvGetNasTimer(uint8_t nType, uint8_t nName, CFW_SIM_ID nSimID);
  8280. uint32_t CFW_nvSetNwSearchPrior(uint8_t mode, uint32_t enable, uint8_t bandNum, uint8_t *bandList, CFW_SIM_ID nSimID);
  8281. uint32_t CFW_nvGetNwSearchPrior(uint32_t *enable, uint8_t *bandNum, uint8_t *bandList, CFW_SIM_ID nSimID);
  8282. uint32_t CFW_SimPollReq(uint32_t nTimerOut, CFW_SIM_ID nSimID);
  8283. uint32_t CFW_NwSetLocalRelease(CFW_SIM_ID nSimID);
  8284. bool CFW_SatGetRawData(uint8_t *pRawData, uint16_t *nRawDataLen, CFW_SIM_ID nSimID);
  8285. uint32_t CFW_SatTerminalResponse(uint8_t *data, uint16_t length, uint16_t nUTI, CFW_SIM_ID nSimID);
  8286. uint32_t CFW_SatTerminalEnvelope(uint8_t *data, uint16_t length, uint16_t nUTI, CFW_SIM_ID nSimID);
  8287. bool CFW_SatGetMenuTitle(uint8_t *title, uint8_t *title_length, CFW_SIM_ID nSimID);
  8288. bool CFW_SatGetMenuItemByID(uint8_t item_id, uint8_t *item, uint8_t *item_length, CFW_SIM_ID nSimID);
  8289. bool CFW_SatGetMenuCurrentItem(uint8_t *item, uint8_t *item_length, uint8_t *item_id, CFW_SIM_ID nSimID);
  8290. bool CFW_SatGetMenuFirstItem(uint8_t *item, uint8_t *item_length, uint8_t *item_id, CFW_SIM_ID nSimID);
  8291. bool CFW_SatGetMenuNextItem(uint8_t *item, uint8_t *item_length, uint8_t *item_id, CFW_SIM_ID nSimID);
  8292. bool CFW_SatGetSubMenuTitle(uint8_t *title, uint8_t *title_length, CFW_SIM_ID nSimID);
  8293. bool CFW_SatGetSubMenuItemByID(uint8_t item_id, uint8_t *item, uint8_t *item_length, CFW_SIM_ID nSimID);
  8294. bool CFW_SatGetSubMenuCurrentItem(uint8_t *item, uint8_t *item_length, uint8_t *item_id, CFW_SIM_ID nSimID);
  8295. bool CFW_SatGetSubMenuFirstItem(uint8_t *item, uint8_t *item_length, uint8_t *item_id, CFW_SIM_ID nSimID);
  8296. bool CFW_SatGetSubMenuNextItem(uint8_t *item, uint8_t *item_length, uint8_t *item_id, CFW_SIM_ID nSimID);
  8297. bool CFW_SatGetSendSmsServiceCenterAddr(uint8_t *addr, uint8_t *addr_length, uint8_t *addr_type, CFW_SIM_ID nSimID);
  8298. bool CFW_SatGetSendSmsTPDU(uint8_t *tpdu, uint8_t *tpdu_length, CFW_SIM_ID nSimID);
  8299. bool CFW_SatGetSendSmsAlpha(uint8_t *alpha, uint8_t *alpha_length, CFW_SIM_ID nSimID);
  8300. bool CFW_SatGetDisplayText(uint8_t *text, uint8_t *text_length, uint8_t *dcs, CFW_SIM_ID nSimID);
  8301. bool CFW_SatGetGetInKeyText(uint8_t *text, uint8_t *text_length, uint8_t *dcs, CFW_SIM_ID nSimID);
  8302. bool CFW_SatGetGetInputText(uint8_t *text, uint8_t *text_length, uint8_t *dcs, CFW_SIM_ID nSimID);
  8303. bool CFW_SatGetGetInputLengthRange(uint8_t *max_len, uint8_t *min_len, CFW_SIM_ID nSimID);
  8304. bool CFW_SatGetGetInputDefaultText(uint8_t *text, uint8_t *text_length, uint8_t *dcs, CFW_SIM_ID nSimID);
  8305. //use for stage parameter
  8306. #define SAT_SETUP_CALL_CONFIRM_TEXT 0x01
  8307. #define SAT_SETUP_CALL_SETUP_TEXT 0x02
  8308. bool CFW_SatGetSetupCallText(uint8_t stage, uint8_t *text, uint8_t *text_length, CFW_SIM_ID nSimID);
  8309. //use for which parameter
  8310. #define SAT_SETUP_CALL_ADDRESS 0x01
  8311. #define SAT_SETUP_CALL_SUBADDRESS 0x02
  8312. bool CFW_SatGetSetupCallAddr(uint8_t which, uint8_t *addr, uint8_t *addr_length, uint8_t *addr_type, CFW_SIM_ID nSimID);
  8313. bool CFW_SatGetSetupCallCapCfg(uint8_t *cfg, uint8_t *cfg_length, uint8_t *unit, uint8_t *interval, CFW_SIM_ID nSimID);
  8314. bool CFW_SatGetSendSSDisplayInfo(uint8_t *text, uint8_t *text_length, uint8_t *icon_identifier,
  8315. uint8_t *icon_qualifier, CFW_SIM_ID nSimID);
  8316. bool CFW_SatGetSendSSInfo(uint8_t *ss, uint8_t *ss_length, uint8_t *ss_type, CFW_SIM_ID nSimID);
  8317. bool CFW_SatGetSendUSSDDisplayInfo(uint8_t *text, uint8_t *text_length, uint8_t *icon_identifier,
  8318. uint8_t *icon_qualifier, CFW_SIM_ID nSimID);
  8319. bool CFW_SatGetSendUSSDInfo(uint8_t *ussd, uint8_t *ussd_length, uint8_t *dcs, CFW_SIM_ID nSimID);
  8320. bool CFW_SatGetSendDTMFInfo(uint8_t *text, uint8_t *text_length, uint8_t *dtmf, uint8_t *dtmf_length, CFW_SIM_ID nSimID);
  8321. bool CFW_SatGetSendDTMFText(uint8_t *text, uint8_t *text_length, CFW_SIM_ID nSimID);
  8322. bool CFW_SatGetSendDTMF(uint8_t *dtmf, uint8_t *dtmf_length, CFW_SIM_ID nSimID);
  8323. bool CFW_SatGetSetupIdleMode(uint8_t *mode_text, uint8_t *mode_text_length, uint8_t *dcs,
  8324. uint8_t *icon_identifier, uint8_t *icon_qualifier, CFW_SIM_ID nSimID);
  8325. bool CFW_SatGetLanguageNotification(uint8_t language[2], CFW_SIM_ID nSimID);
  8326. bool CFW_SatGetPlayTone(uint8_t *tone, uint8_t *unit, uint8_t *interval, CFW_SIM_ID nSimID);
  8327. #define UICC_TYPE_SIM 0
  8328. #define UICC_TYPE_USIM 1
  8329. uint32_t CFW_SimSetMeProfile(CFW_PROFILE *pMeProfile, uint8_t uicc_type);
  8330. #define UICC_SAT_ENABLE 0
  8331. #define UICC_SAT_DISABLE 1
  8332. uint32_t CFW_SatSetFacility(uint8_t status, CFW_SIM_ID nSimID);
  8333. uint8_t CFW_SatGetFacility(CFW_SIM_ID nSimID);
  8334. uint32_t CFW_StackInit(CFW_SIM_ID nSimID);
  8335. #ifdef FUNC_SUPPORT_SIMLOCK
  8336. #define CFW_SIM_LOCK_ENCRYPTED_KEY_MAX_LEN 32 /* MAX length of control key in encrypted data format */
  8337. typedef struct
  8338. {
  8339. uint8_t nck[CFW_SIM_LOCK_ENCRYPTED_KEY_MAX_LEN];
  8340. uint8_t nsck[CFW_SIM_LOCK_ENCRYPTED_KEY_MAX_LEN];
  8341. uint8_t spck[CFW_SIM_LOCK_ENCRYPTED_KEY_MAX_LEN];
  8342. uint8_t cck[CFW_SIM_LOCK_ENCRYPTED_KEY_MAX_LEN];
  8343. uint8_t pck[CFW_SIM_LOCK_ENCRYPTED_KEY_MAX_LEN];
  8344. } cfw_simlock_encrypt_keyinfo_t;
  8345. typedef struct
  8346. {
  8347. cfw_simlock_encrypt_keyinfo_t pin_keys;
  8348. cfw_simlock_encrypt_keyinfo_t puk_keys;
  8349. } cfw_simlock_encrypt_keys_t;
  8350. uint32_t CFW_SimlockDataProcess(char *pData, uint16_t nDataSize, uint8_t nFlag, CFW_SIM_ID nSimID);
  8351. uint32_t CFW_SimlockEncryptKeys(char *pData, uint16_t nDataSize, char encrypt_data[800], uint16_t en_len, CFW_SIM_ID nSimID);
  8352. uint32_t CFW_SimlockImeiProcess(char *pData, uint16_t nDataSize, uint8_t nFlag, uint16_t nUTI, CFW_SIM_ID nSimID);
  8353. uint32_t CFW_SimlockSetHuk(char *pData, uint16_t nDataSize, CFW_SIM_ID nSimID);
  8354. uint32_t CFW_SimlockFacauthPubkey(char *pubkey, uint16_t nPubkeySize, char *sign, uint16_t nSignSize, CFW_SIM_ID nSimID);
  8355. uint32_t CFW_SimlockAuthStart(char data[512], uint32_t *len, CFW_SIM_ID nSimID);
  8356. uint32_t CFW_SimlockAuthEnd(char *data, uint32_t len, CFW_SIM_ID nSimID);
  8357. uint32_t CFW_SimlockToolGetUid(uint8_t uidData[128], uint8_t len, CFW_SIM_ID nSimID);
  8358. uint32_t CFW_SimlockDataCheckUnlock(CFW_SIM_ID nSimID);
  8359. uint32_t CFW_SimlockDataCheckLock(char *data, uint16_t len, uint8_t nFlag, CFW_SIM_ID nSimID);
  8360. uint32_t CFW_SimlockImeiVerify(uint16_t nUTI, CFW_SIM_ID nSimID);
  8361. uint32_t CFW_SimlockSetVersion(char *data, uint16_t len, CFW_SIM_ID nSimID);
  8362. #endif
  8363. uint32_t CFW_SetMoSmsRetryCount(uint8_t smc_count, uint8_t smr_count, CFW_SIM_ID nSimID);
  8364. uint32_t CFW_CbSetType(uint8_t nCbType, CFW_SIM_ID nSimID);
  8365. bool CFW_DecodeCDMAImsi(uint8_t *pImsi, uint8_t *pCdmaImsiM);
  8366. uint32_t CFW_SimGetCdmaImsi(uint16_t nUTI, CFW_SIM_ID nSimID);
  8367. typedef struct
  8368. {
  8369. uint16_t arfcn;
  8370. uint8_t lai[5];
  8371. uint8_t bsic;
  8372. } cfw_GsmCell_t;
  8373. typedef struct
  8374. {
  8375. uint8_t num;
  8376. cfw_GsmCell_t BlackCellList[CFW_MAX_BLACK_CELL_NUM]; //synchronize with protocol stack
  8377. } CFW_NW_BLKLIST_GSM_INFO;
  8378. uint32_t CFW_CusPrivatePsm(uint8_t flag, uint16_t time, CFW_SIM_ID nSimID);
  8379. typedef struct _CFW_NET_DL_PSM_PARAM
  8380. {
  8381. bool rrcConnection;
  8382. uint32_t t3412Len;
  8383. uint32_t t3412RemainLen;
  8384. uint32_t t3324Len;
  8385. uint32_t t3324RemainLen;
  8386. } CFW_NET_DL_PSM_PARAM_T;
  8387. uint32_t CFW_GetNetDLPsmParam(uint16_t nUti, CFW_SIM_ID nSimID);
  8388. #define CFW_MAX_TAC_NUM 2
  8389. typedef enum _CFW_ENG_EVT_RPT_ENUM
  8390. {
  8391. CFW_ENG_EVENT_INIT_ACC_RPT,
  8392. CFW_ENG_EVENT_MAC_ACC_FAIL_RPT,
  8393. CFW_ENG_EVENT_T310_EXPIRE_RPT,
  8394. CFW_ENG_EVENT_RLC_MAX_NUM_RETRAN_RPT,
  8395. CFW_ENG_EVENT_RRC_STATUS_RPT,
  8396. CFW_ENG_EVENT_RRC_EST_REQ_RPT,
  8397. CFW_ENG_EVENT_RRC_EST_FAIL_RPT,
  8398. CFW_ENG_EVENT_INTRA_LTE_HO_REQ_RPT,
  8399. CFW_ENG_EVENT_INTRA_LTE_HO_FAIL_RPT,
  8400. CFW_ENG_EVENT_INTRA_LTE_HO_SUCC_RPT,
  8401. CFW_ENG_EVENT_IRAT_HO_REQ_RPT,
  8402. CFW_ENG_EVENT_IRAT_HO_FAIL_RPT,
  8403. CFW_ENG_EVENT_IRAT_HO_SUCC_RPT,
  8404. CFW_ENG_EVENT_IRAT_CCO_REQ_RPT,
  8405. CFW_ENG_EVENT_IRAT_CCO_FAIL_RPT,
  8406. CFW_ENG_EVENT_IRAT_CCO_SUCC_RPT,
  8407. CFW_ENG_EVENT_IRAT_REDIREC_REQ_RPT,
  8408. CFW_ENG_EVENT_IRAT_REDIREC_FAIL_RPT,
  8409. CFW_ENG_EVENT_IRAT_REDIREC_SUCC_RPT,
  8410. CFW_ENG_EVENT_IRAT_GSM_CCO_LTE_REQ,
  8411. CFW_ENG_EVENT_IRAT_GSM_CCO_LTE_FAIL,
  8412. CFW_ENG_EVENT_IRAT_GSM_CCO_LTE_SUCCESS,
  8413. CFW_ENG_EVENT_IRAT_GSM_REDIREC_REQ_RPT,
  8414. CFW_ENG_EVENT_IRAT_GSM_REDIREC_FAIL_RPT,
  8415. CFW_ENG_EVENT_IRAT_GSM_REDIREC_SUCC_RPT,
  8416. } CFW_ENG_EVT_RPT_ENUM_T;
  8417. typedef enum _CFW_EVENT_RPT_MODE_TYPE
  8418. {
  8419. CFW_ENG_EVENT_RPT_MODE_TYPE_LTE,
  8420. CFW_ENG_EVENT_RPT_MODE_TYPE_GSM
  8421. } CFW_EVENT_RPT_MODE_TYPE;
  8422. typedef enum _CFW_EVENT_RPT_RRC_STATUS
  8423. {
  8424. CFW_ENG_EVENT_RPT_RRC_RELEASED,
  8425. CFW_ENG_EVENT_RPT_RRC_CONNECTED
  8426. } CFW_EVENT_RPT_RRC_STATUS;
  8427. typedef enum _CFW_EVENT_RRC_EST_FAIL_CAUSE
  8428. {
  8429. CFW_ENG_EVENT_RRC_EST_FAIL_ACC_BAR,
  8430. CFW_ENG_EVENT_RRC_EST_FAIL_T300_EXPIRE,
  8431. CFW_ENG_EVENT_RRC_EST_FAIL_ABORT,
  8432. CFW_ENG_EVENT_RRC_EST_FAIL_REJECT
  8433. } CFW_EVENT_RRC_EST_FAIL_CAUSE;
  8434. typedef struct _CFW_PLMN_TAG
  8435. {
  8436. uint8_t mcc[2]; //Mobile Colour Code (octet 1, octet 2 bits 1 to 4)
  8437. uint8_t mnc; //Mobile Network Code (octet 3, octet 2bits 5 to 8);
  8438. uint8_t reserved;
  8439. } CFW_PLMN_TAG;
  8440. typedef struct _CFW_ENGEVTRPT_CELL_INFO_Tag
  8441. {
  8442. uint8_t tac[CFW_MAX_TAC_NUM];
  8443. uint16_t pci;
  8444. uint32_t cellIdentity;
  8445. uint32_t dlEarfcn;
  8446. CFW_PLMN_TAG plmn;
  8447. } CFW_ENGEVTRPT_CELL_INFO;
  8448. typedef struct CFW_ENGEVTRPT_INITACC_RPT_Tag
  8449. {
  8450. CFW_EVENT_RPT_MODE_TYPE mode;
  8451. uint16_t accResult;
  8452. uint16_t reserved;
  8453. CFW_ENGEVTRPT_CELL_INFO cellInfo;
  8454. } CFW_ENGEVTRPT_INITACC_RPT;
  8455. typedef struct CFW_ENGEVTRPT_MACACCFAIL_RPT_Tag
  8456. {
  8457. CFW_ENGEVTRPT_CELL_INFO cellInfo;
  8458. } CFW_ENGEVTRPT_MACACCFAIL_RPT;
  8459. typedef struct CFW_ENGEVTRPT_T310EXPI_RPT_Tag
  8460. {
  8461. CFW_ENGEVTRPT_CELL_INFO cellInfo;
  8462. } CFW_ENGEVTRPT_T310EXPI_RPT;
  8463. typedef struct CFW_ENGEVTRPT_RLCMAXRETRAN_RPT_Tag
  8464. {
  8465. CFW_ENGEVTRPT_CELL_INFO cellInfo;
  8466. } CFW_ENGEVTRPT_RLCMAXRETRAN_RPT;
  8467. typedef struct CFW_ENGEVTRPT_RRCSTATUS_RPT_Tag
  8468. {
  8469. CFW_EVENT_RPT_RRC_STATUS rrcStatus;
  8470. CFW_ENGEVTRPT_CELL_INFO cellInfo;
  8471. } CFW_ENGEVTRPT_RRCSTATUS_RPT;
  8472. typedef struct CFW_ENGEVTRPT_RRCESTREQ_RPT_Tag
  8473. {
  8474. CFW_ENGEVTRPT_CELL_INFO cellInfo;
  8475. } CFW_ENGEVTRPT_RRCESTREQ_RPT;
  8476. typedef struct CFW_ENGEVTRPT_RRCESTFAIL_RPT_Tag
  8477. {
  8478. CFW_EVENT_RRC_EST_FAIL_CAUSE failCause;
  8479. CFW_ENGEVTRPT_CELL_INFO cellInfo;
  8480. } CFW_ENGEVTRPT_RRCESTFAIL_RPT;
  8481. typedef struct CFW_ENGEVTRPT_INTRALTE_HO_RPT_Tag
  8482. {
  8483. uint16_t targetPci;
  8484. uint16_t reserved;
  8485. uint32_t targetDlEarfcn;
  8486. CFW_ENGEVTRPT_CELL_INFO orgCellInfo;
  8487. } CFW_ENGEVTRPT_INTRALTE_HO_RPT;
  8488. #define CFW_MAX_REDIRECTION_GSM_CELL_NUM 32
  8489. typedef struct _CFW_ENGEVTRPT_IRAT_ORGLTE_INFO
  8490. {
  8491. uint8_t mode;
  8492. uint8_t reserved[3];
  8493. CFW_ENGEVTRPT_CELL_INFO cellInfo;
  8494. } CFW_ENGEVTRPT_IRAT_ORGLTE_INFO;
  8495. typedef struct _CFW_ENGEVTRPT_IRAT_TARGETGSM_INFO
  8496. {
  8497. uint8_t mode;
  8498. uint8_t gsmBandIndicator;
  8499. uint8_t bsic;
  8500. uint8_t reserved;
  8501. uint16_t dlArfcn;
  8502. uint8_t reserved1[2];
  8503. } CFW_ENGEVTRPT_IRAT_TARGETGSM_INFO;
  8504. typedef struct _CFW_ENGEVTRPT_IRAT_REDIREC_GSMCELL_INFO
  8505. {
  8506. uint8_t bsic;
  8507. uint8_t nccPermitted;
  8508. uint16_t arfcn;
  8509. } CFW_ENGEVTRPT_IRAT_REDIREC_GSMCELL_INFO;
  8510. typedef struct _CFW_ENGEVTRPT_IRAT_REDIREC_TARGETGSM_LIST
  8511. {
  8512. uint8_t mode;
  8513. uint8_t gsmCellNum;
  8514. uint16_t reserved;
  8515. CFW_ENGEVTRPT_IRAT_REDIREC_GSMCELL_INFO gsmCell[CFW_MAX_REDIRECTION_GSM_CELL_NUM];
  8516. } CFW_ENGEVTRPT_IRAT_REDIREC_TARGETGSM_LIST;
  8517. typedef struct CFW_ENGEVTRPT_IRAT_L2G_RPT_Tag
  8518. {
  8519. CFW_ENGEVTRPT_IRAT_ORGLTE_INFO orgLteCellInfo;
  8520. CFW_ENGEVTRPT_IRAT_TARGETGSM_INFO targetGsmCellInfo;
  8521. } CFW_ENGEVTRPT_IRAT_L2G_RPT;
  8522. typedef struct CFW_ENGEVTRPT_IRAT_L2G_REDIREC_RPT_Tag
  8523. {
  8524. CFW_ENGEVTRPT_IRAT_ORGLTE_INFO orgLteCellInfo;
  8525. CFW_ENGEVTRPT_IRAT_REDIREC_TARGETGSM_LIST targetGsmCellList;
  8526. } CFW_ENGEVTRPT_IRAT_L2G_REDIREC_RPT;
  8527. typedef struct
  8528. {
  8529. uint8_t Arfcn;
  8530. uint8_t Plmn[3];
  8531. uint8_t BSIC;
  8532. uint8_t LAC[2];
  8533. uint8_t CellId[2];
  8534. } cfw_gsmSouceCellInfo_t;
  8535. typedef struct
  8536. {
  8537. uint16_t Arfcn;
  8538. uint8_t Plmn[3];
  8539. uint8_t BSIC;
  8540. uint8_t LAC[2];
  8541. uint8_t CellId[2];
  8542. } cfw_gsmSouceCellInfo_v2_t;
  8543. typedef struct
  8544. {
  8545. uint32_t Earfcn;
  8546. uint32_t Pci;
  8547. } cfw_lteTargetCellInfo_t;
  8548. #define CFW_MAX_LTE_CELL_NUM 16
  8549. typedef struct
  8550. {
  8551. cfw_gsmSouceCellInfo_t GsmSourceCell;
  8552. uint8_t NumOfTargetCell;
  8553. cfw_lteTargetCellInfo_t LteTargetCell[CFW_MAX_LTE_CELL_NUM];
  8554. } cfw_GsmChangeToLteInd_t;
  8555. typedef struct
  8556. {
  8557. cfw_gsmSouceCellInfo_v2_t GsmSourceCell;
  8558. uint8_t NumOfTargetCell;
  8559. cfw_lteTargetCellInfo_t LteTargetCell[CFW_MAX_LTE_CELL_NUM];
  8560. } cfw_GsmChangeToLteInd_v2_t;
  8561. typedef struct
  8562. {
  8563. uint8_t eventId;
  8564. uint8_t reserved[3];
  8565. union {
  8566. CFW_ENGEVTRPT_INITACC_RPT initAccInfo;
  8567. CFW_ENGEVTRPT_MACACCFAIL_RPT macAccFailInfo;
  8568. CFW_ENGEVTRPT_T310EXPI_RPT t310ExpiredInfo;
  8569. CFW_ENGEVTRPT_RLCMAXRETRAN_RPT rlcMaxNumRetranInfo;
  8570. CFW_ENGEVTRPT_RRCSTATUS_RPT rrcStatusInfo;
  8571. CFW_ENGEVTRPT_RRCESTREQ_RPT rrcEstReqInfo;
  8572. CFW_ENGEVTRPT_RRCESTFAIL_RPT rrcEstFailInfo;
  8573. CFW_ENGEVTRPT_INTRALTE_HO_RPT intraLteHoInfo;
  8574. CFW_ENGEVTRPT_IRAT_L2G_RPT IratHoL2GInfo;
  8575. CFW_ENGEVTRPT_IRAT_L2G_REDIREC_RPT IratRedirectionL2GInfo;
  8576. cfw_GsmChangeToLteInd_t GsmChangeToLte;
  8577. };
  8578. } CFW_ENG_EVENT_RPT;
  8579. typedef struct
  8580. {
  8581. uint8_t eventId;
  8582. uint8_t reserved[3];
  8583. union {
  8584. CFW_ENGEVTRPT_INITACC_RPT initAccInfo;
  8585. CFW_ENGEVTRPT_MACACCFAIL_RPT macAccFailInfo;
  8586. CFW_ENGEVTRPT_T310EXPI_RPT t310ExpiredInfo;
  8587. CFW_ENGEVTRPT_RLCMAXRETRAN_RPT rlcMaxNumRetranInfo;
  8588. CFW_ENGEVTRPT_RRCSTATUS_RPT rrcStatusInfo;
  8589. CFW_ENGEVTRPT_RRCESTREQ_RPT rrcEstReqInfo;
  8590. CFW_ENGEVTRPT_RRCESTFAIL_RPT rrcEstFailInfo;
  8591. CFW_ENGEVTRPT_INTRALTE_HO_RPT intraLteHoInfo;
  8592. CFW_ENGEVTRPT_IRAT_L2G_RPT IratHoL2GInfo;
  8593. CFW_ENGEVTRPT_IRAT_L2G_REDIREC_RPT IratRedirectionL2GInfo;
  8594. cfw_GsmChangeToLteInd_v2_t GsmChangeToLte;
  8595. };
  8596. } CFW_ENG_EVENT_RPT_V2;
  8597. #define CFW_L2_WB_MAX_DRB_NUM 8
  8598. typedef struct CFW_ENGSTATISRPT_RLC_INSTSTATIS_Tag
  8599. {
  8600. uint8_t drbId;
  8601. uint8_t reserved[3];
  8602. uint16_t ulAmDataPduNackNum;
  8603. uint16_t ulAmDataPduAckNum;
  8604. uint32_t ulAmDataPduRetrRate;
  8605. uint32_t ulAmNewPduByte;
  8606. uint32_t ulAmDataPduNackByte;
  8607. uint32_t ulAmDataPduAckByte;
  8608. uint32_t sendBufferRemain;
  8609. uint32_t dlAmPduByte;
  8610. } CFW_ENGSTATISRPT_RLC_INSTSTATIS;
  8611. typedef struct CFW_ENGSTATISRPT_PDCP_INSTSTATIS_Tag
  8612. {
  8613. uint8_t drbId;
  8614. uint8_t reserved[3];
  8615. uint32_t ulPacketDiscardRate;
  8616. } CFW_ENGSTATISRPT_PDCP_INSTSTATIS;
  8617. typedef struct CFW_ENGSTATISRPT_EL2_RPT_Tag
  8618. {
  8619. CFW_ENGSTATISRPT_RLC_INSTSTATIS rlcInstStatis[CFW_L2_WB_MAX_DRB_NUM];
  8620. CFW_ENGSTATISRPT_PDCP_INSTSTATIS pdcpInstStatis[CFW_L2_WB_MAX_DRB_NUM];
  8621. } CFW_ENGSTATISRPT_EL2_RPT;
  8622. typedef struct CFW_ENGSTATISRPT_EL1_RPT_Tag
  8623. {
  8624. int16_t ta;
  8625. uint16_t phr;
  8626. } CFW_ENGSTATISRPT_EL1_RPT;
  8627. typedef struct
  8628. {
  8629. uint8_t el1ValidFlag;
  8630. CFW_ENGSTATISRPT_EL1_RPT el1StatisInfo;
  8631. } CFW_ENG_STATIS_RPT_EL1;
  8632. typedef struct
  8633. {
  8634. uint8_t el1ValidFlag;
  8635. uint8_t el2ValidFlag;
  8636. CFW_ENGSTATISRPT_EL1_RPT el1StatisInfo;
  8637. CFW_ENGSTATISRPT_EL2_RPT el2StatisInfo;
  8638. } CFW_ENG_STATIS_RPT;
  8639. typedef struct
  8640. {
  8641. uint8_t atEl2StatisType;
  8642. uint32_t atEl2Threshold;
  8643. uint32_t atPhyTimeThreshold;
  8644. } CFW_STATIS_INFO_CFG_RPT;
  8645. uint32_t CFW_NwErrcStatisCfg(CFW_STATIS_INFO_CFG_RPT cfg_rpt, CFW_SIM_ID nSimID);
  8646. uint32_t CFW_NwGetStatisticRpt(CFW_ENG_STATIS_RPT *pEngStatisRpt, CFW_SIM_ID nSimID);
  8647. typedef struct
  8648. {
  8649. int16_t thresholdOffsetP; //Setup value of the idle measurement threshold offset for Srxlev
  8650. int16_t thresholdOffsetQ; //Setup value of the idle measurement threshold offset for Squal
  8651. int16_t neighborOffsetRSRP; //Setup value for the RSRP offset of neighbor cells in idle measurement
  8652. int16_t neighborOffsetRSRQ; //Setup value for the RSRQ offset of neighbor cells in idle measurement
  8653. } CFW_MEAS_OFFSET_T;
  8654. uint32_t CFW_ErrcSetMeasThreshold(CFW_MEAS_OFFSET_T meas_cfg, CFW_SIM_ID nSim);
  8655. uint32_t CFW_ErrcGetMeasThreshold(uint16_t nUTI, CFW_SIM_ID nSim);
  8656. typedef struct
  8657. {
  8658. uint8_t state;
  8659. } CFW_RACH_RESULT_IND;
  8660. #define CFW_MAX_STORED_USR_EARFCN_NUM 16
  8661. typedef struct CFW_StoredUsrFreqInfo_Tag
  8662. {
  8663. uint32_t arfcn;
  8664. uint8_t reserved;
  8665. uint8_t plmn[3];
  8666. } CFW_StoredUsrFreqInfo;
  8667. typedef struct CFW_UsrHisFreqInfo_Tag
  8668. {
  8669. uint8_t arfcnNum;
  8670. uint8_t reserved[3];
  8671. CFW_StoredUsrFreqInfo storedUsrFreqInfo[CFW_MAX_STORED_USR_EARFCN_NUM];
  8672. } CFW_UsrHisFreqInfo;
  8673. typedef struct
  8674. {
  8675. uint8_t bitmask;
  8676. uint8_t emmMsgType;
  8677. uint8_t esmMsgType;
  8678. uint8_t emmCause;
  8679. uint8_t esmCause;
  8680. uint8_t reserved[3];
  8681. } CFW_NW_EMM_FAILED_PROCEDURE_T;
  8682. uint32_t CFW_SetUsrHisFreqInfo(CFW_StoredUsrFreqInfo pHisFreqInfo, uint8_t bOperFlag, CFW_SIM_ID nSimID);
  8683. uint32_t CFW_GetUsrHisFreqInfo(CFW_UsrHisFreqInfo *pHisFreqInfo, CFW_SIM_ID nSimID);
  8684. uint8_t CFW_GetDefaultPcoControl(CFW_SIM_ID nSimID); //return 1:PDN req with Attach no set pco; 0: PDN req with Attach no change
  8685. uint32_t CFW_SetDefaultPcoControl(uint8_t nValue, CFW_SIM_ID nSimID); //value 1:PDN req with Attach no set pco; 0: PDN req with Attach no change
  8686. uint32_t CFW_SetVocLoopType(uint16_t type, CFW_SIM_ID nSimID);
  8687. uint32_t CFW_GprsSendDefaultCtx(uint8_t nSimID); //config default apn,pdptype,authprot,username,password
  8688. #ifdef CONFIG_SOC_8811
  8689. void CFW_DefaultEpsBearerRejFromAP(uint8_t uCause);
  8690. #endif
  8691. uint32_t CFW_SetInitStack(bool status, CFW_SIM_ID nSimID);
  8692. uint32_t CFW_SimResetStatus(CFW_SIM_ID nSimID);
  8693. #endif //if cfw.h