package Ġcom . google . chip . ch ipt ool . cluster client Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . util . Log Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroid . view . input method . Editor Info Ċ import Ġandroid . widget . Array Adapter Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . lifecycle . lifecycle Scope Ċ import Ġchip . device controller . Chip Clusters Ċ import Ġchip . device controller . Chip Clusters . Basic Cluster Ċ import Ġchip . device controller . Chip Device Controller Ċ import Ġcom . google . chip . ch ipt ool . Chip Client Ċ import Ġcom . google . chip . ch ipt ool . Generic Chip Device Listener Ċ import Ġcom . google . chip . ch ipt ool . R Ċ import Ġkotlinx . android . synt hetic . main . basic _ client _ fragment . attribute Name Spinner Ċ import Ġkotlinx . android . synt hetic . main . basic _ client _ fragment . basic Cluster Command Status Ċ import Ġkotlinx . android . synt hetic . main . basic _ client _ fragment . location Ed Ċ import Ġkotlinx . android . synt hetic . main . basic _ client _ fragment . node Label Ed Ċ import Ġkotlinx . android . synt hetic . main . basic _ client _ fragment . view . attribute Name Spinner Ċ import Ġkotlinx . android . synt hetic . main . basic _ client _ fragment . view . read Attribute Btn Ċ import Ġkotlinx . android . synt hetic . main . basic _ client _ fragment . view . write Local Config Disabled Switch Ċ import Ġkotlinx . android . synt hetic . main . basic _ client _ fragment . view . write Location Btn Ċ import Ġkotlinx . android . synt hetic . main . basic _ client _ fragment . view . write Node Label Btn Ċ import Ġkotlinx . coroutines . Coroutine Scope Ċ import Ġkotlinx . coroutines . launch Ċ Ċ class ĠBasic Client Fragment Ġ: ĠFragment () Ġ{ ĊĠ Ġprivate Ġval Ġdevice Controller : ĠCh ip Device Controller ĊĠĠĠ Ġget () Ġ= ĠCh ip Client . getDevice Controller ( require Context ()) ĊĊĠ Ġprivate Ġlateinit Ġvar Ġscope : ĠCor outine Scope ĊĊĠ Ġprivate Ġlateinit Ġvar Ġaddress Update Fragment : ĠAddress Update Fragment ĊĊĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠ Ġ): ĠView Ġ{ ĊĠĠĠ Ġscope Ġ= Ġview Lifecycle Owner . lifecycle Scope ĊĊĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . basic _ client _ fragment , Ġcontainer , Ġfalse ). apply Ġ{ ĊĠĠĠĠĠ Ġdevice Controller . set Completion Listener ( Chip Controller Callback ()) ĊĊĠĠĠĠĠ Ġaddress Update Fragment Ġ= ĊĠĠĠĠĠĠĠ Ġchild FragmentManager . find Fragment ById ( R . id . address Update Fragment ) Ġas ĠAddress Update Fragment ĊĊĠĠĠĠĠ Ġwrite Node Label Btn . setOnClickListener Ġ{ Ġscope . launch Ġ{ ĊĠĠĠĠĠĠĠ Ġsend Write Node Label Attribute () ĊĠĠĠĠĠĠĠ Ġnode Label Ed . on Editor Action ( Editor Info . IME _ ACTION _ DONE ) ĊĠĠĠĠĠ Ġ}} ĊĠĠĠĠĠ Ġwrite Location Btn . setOnClickListener Ġ{ Ġscope . launch Ġ{ ĊĠĠĠĠĠĠĠ Ġsend Write Location Attribute () ĊĠĠĠĠĠĠĠ Ġlocation Ed . on Editor Action ( Editor Info . IME _ ACTION _ DONE ) ĊĠĠĠĠĠ Ġ}} ĊĠĠĠĠĠ Ġwrite Local Config Disabled Switch . setOn Checked ChangeListener Ġ{ Ġ_, Ġis Checked Ġ-> ĊĠĠĠĠĠĠĠ Ġscope . launch Ġ{ Ġsend Write Local Config Disabled Attribute ( isChecked ) Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġmake Attribute List () ĊĠĠĠĠĠ Ġattribute Name Spinner . adapter Ġ= Ġmake Attribute Names Adapter () ĊĠĠĠĠĠ Ġread Attribute Btn . setOnClickListener Ġ{ Ġscope . launch Ġ{ Ġread Attribute Button Click () Ġ}} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġinner Ġclass ĠCh ip Controller Callback Ġ: ĠGeneric Chip Device Listener () Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġon Connect Device Complete () Ġ{} ĊĊĠĠĠ Ġoverride Ġfun Ġon Com mission ing Complete ( nodeId : ĠLong , ĠerrorCode : ĠInt ) Ġ{ ĊĠĠĠĠĠ ĠLog . d ( TAG , Ġ" on Com mission ing Complete Ġfor ĠnodeId Ġ$ nodeId : Ġ$ errorCode ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Notify Chip Connection Closed () Ġ{ ĊĠĠĠĠĠ ĠLog . d ( TAG , Ġ" on Notify Chip Connection Closed ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonClose B le Complete () Ġ{ ĊĠĠĠĠĠ ĠLog . d ( TAG , Ġ" onClose B le Complete ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonError ( error : ĠThrowable ?) Ġ{ ĊĠĠĠĠĠ ĠLog . d ( TAG , Ġ" onError : Ġ$ error ") ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĊĠ Ġprivate Ġfun Ġmake Attribute Names Adapter (): ĠArray Adapter < String > Ġ{ ĊĠĠĠ Ġreturn ĠArray Adapter ( ĊĠĠĠĠĠ Ġrequire Context (), ĊĠĠĠĠĠ Ġandroid . R . layout . simple _ spinner _ dropdown _ item , ĊĠĠĠĠĠ ĠATTRIBUT ES . toList () ĊĠĠĠ Ġ). apply Ġ{ ĊĠĠĠĠĠ Ġset DropDown View Resource ( android . R . layout . simple _ spinner _ dropdown _ item ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġread Attribute Button Click () Ġ{ ĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠ Ġread Basic Clusters ( attribute Name Spinner . selected Item Position ) ĊĠĠĠ Ġ} Ġcatch Ġ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠ Ġshow Message (" read Basic Cluster Ġfailed : Ġ$ ex ") ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġread Basic Clusters ( item Index : ĠInt ) Ġ{ ĊĠĠĠ Ġwhen ( ATTRIBUTES [ item Index ]) Ġ{ ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ interaction _ mode _ version _ text ) Ġ-> Ġsend Read Interaction Model Version Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ vendor _ name _ text ) Ġ-> Ġsend Read Vendor Name Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ vendor _ id _ text ) Ġ-> Ġsend Read Vendor ID Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ product _ name _ text ) Ġ-> Ġsend Read ProductName Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ product _ id _ text ) Ġ-> Ġsend Read Product ID Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ node _ label _ text ) Ġ-> Ġsend Read Node Label Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ location _ text ) Ġ-> Ġsend Read Location Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ hardware _ version _ text ) Ġ-> Ġsend Read Hardware Version Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ hardware _ version _ string _ text ) Ġ-> Ġsend Read Hardware Version String Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ software _ version _ text ) Ġ-> Ġsend Read Software Version Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ software _ version _ string _ text ) Ġ-> Ġsend Read Software Version String Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ man ufact uring _ date _ text ) Ġ-> Ġsend Read Man ufact uring Date Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ part _ number _ text ) Ġ-> Ġsend Read Part Number Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ product _ url _ text ) Ġ-> Ġsend Read Product URL Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ product _ label _ text ) Ġ-> Ġsend Read Product Label Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ serial _ number _ text ) Ġ-> Ġsend Read SerialNumber Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ local _ config _ disabled _ text ) Ġ-> Ġsend Read Local Config Disabled Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ reachable _ text ) Ġ-> Ġsend Read Reach able Attribute () ĊĠĠĠĠĠ ĠgetString ( R . string . basic _ cluster _ cluster _ revision _ text ) Ġ-> Ġsend Read Cluster Revision Attribute () ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġmake Attribute List () Ġ{ ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ interaction _ mode _ version _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ vendor _ name _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ vendor _ id _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ product _ name _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ product _ id _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ node _ label _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ location _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ hardware _ version _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ hardware _ version _ string _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ software _ version _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ software _ version _ string _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ man ufact uring _ date _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ part _ number _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ product _ url _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ product _ label _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ serial _ number _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ local _ config _ disabled _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ reachable _ text )) ĊĠĠĠ ĠATTRIBUT ES . add ( getString ( R . string . basic _ cluster _ cluster _ revision _ text )) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Interaction Model Version Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Interaction Model Version Attribute ( object Ġ: ĠCh ip Clusters . Integer Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠInteraction Model Version : Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠInteraction Model Version : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠInteraction Model Version Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠInteraction Model Version Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Vendor Name Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Vendor Name Attribute ( object Ġ: ĠCh ip Clusters . Char String Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠVendor Name : Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠVendor Name : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠVendor Name Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠVendor Name Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Vendor ID Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Vendor ID Attribute ( object Ġ: ĠCh ip Clusters . Integer Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠVendor ID : Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠVendor ID : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠVendor ID Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠVendor ID Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read ProductName Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read ProductName Attribute ( object Ġ: ĠCh ip Clusters . Char String Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠProduct Name : Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠProduct Name : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠProduct Name Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠProduct Name Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Product ID Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Product ID Attribute ( object Ġ: ĠCh ip Clusters . Integer Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠProduct ID : Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠProduct ID : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠProduct ID Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠProduct ID Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Node Label Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Node Label Attribute ( object Ġ: ĠCh ip Clusters . Char String Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠNode Label : Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠNode Label : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠNode Label Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠNode Label Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Write Node Label Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). write Node Label Attribute ( object Ġ: ĠCh ip Clusters . Default Cluster Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess () Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Write ĠNode Label Ġsuccess ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Write ĠNode Label Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Write ĠNode Label Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}, Ġnode Label Ed . text . toString ()) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Location Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Location Attribute ( object Ġ: ĠCh ip Clusters . Char String Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠLocation : Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠLocation : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠLocation Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠLocation Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Write Location Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). write Location Attribute ( object Ġ: ĠCh ip Clusters . Default Cluster Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess () Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Write ĠLocation Ġsuccess ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Write ĠLocation Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Write ĠLocation Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}, Ġlocation Ed . text . toString ()) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Hardware Version Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Hardware Version Attribute ( object Ġ: ĠCh ip Clusters . Integer Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠHardware Version : Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠHardware Version : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠHardware Version Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠHardware Version Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Hardware Version String Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Hardware Version String Attribute ( object Ġ: ĠCh ip Clusters . Char String Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠHardware Version String : Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠHardware Version String : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠHardware Version String Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠHardware Version String Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Software Version Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Software Version Attribute ( object Ġ: ĠCh ip Clusters . Long Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠLong ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠSoftware Version : Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠSoftware Version : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠSoftware Version Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠSoftware Version Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Software Version String Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Software Version String Attribute ( object Ġ: ĠCh ip Clusters . Char String Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠSoftware Version String Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠSoftware Version String : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠSoftware Version String Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠSoftware Version String Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Man ufact uring Date Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Man ufact uring Date Attribute ( object Ġ: ĠCh ip Clusters . Char String Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠMan ufact uring Date Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠMan ufact uring Date : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠMan ufact uring Date Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠMan ufact uring Date Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Part Number Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Part Number Attribute ( object Ġ: ĠCh ip Clusters . Char String Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠPart Number Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠPart Number : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠPart Number Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠPart Number Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Product URL Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Product URL Attribute ( object Ġ: ĠCh ip Clusters . Char String Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠProduct URL Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠProduct URL : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠProduct URL Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠProduct URL Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Product Label Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Product Label Attribute ( object Ġ: ĠCh ip Clusters . Char String Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠProduct Label Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠProduct Label : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠProduct Label Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠProduct Label Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read SerialNumber Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read SerialNumber Attribute ( object Ġ: ĠCh ip Clusters . Char String Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠSerial Number Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠSerial Number : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠSerial Number Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠSerial Number Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Local Config Disabled Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Local Config Disabled Attribute ( object Ġ: ĠCh ip Clusters . Boolean Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠLocal Config Disabled Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠLocal Config Disabled : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠLocal Config Disabled Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠLocal Config Disabled Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Write Local Config Disabled Attribute ( local Config Disabled : ĠBoolean ) Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). write Local Config Disabled Attribute ( object Ġ: ĠCh ip Clusters . Default Cluster Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess () Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Write ĠLocal Config Disabled Ġsuccess ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Write ĠLocal Config Disabled Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Write ĠLocal Config Disabled Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}, Ġlocal Config Disabled ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Reach able Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Reach able Attribute ( object Ġ: ĠCh ip Clusters . Boolean Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠRe ach able Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠRe ach able : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠRe ach able Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠRe ach able Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġsend Read Cluster Revision Attribute () Ġ{ ĊĠĠĠ Ġget Basic Cluster For Device (). read Cluster Revision Attribute ( object Ġ: ĠCh ip Clusters . Integer Attribute Callback Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun ĠonSuccess ( value : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . i ( TAG ," [ Read ĠSuccess ] ĠCluster Revision Ġ$ value ") ĊĠĠĠĠĠĠĠ Ġshow Message ("[ Read ĠSuccess ] ĠCluster Revision : Ġ$ value ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun ĠonError ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshow Message (" Read ĠCluster Revision Ġfailure Ġ$ ex ") ĊĠĠĠĠĠĠĠ ĠLog . e ( TAG , Ġ" Read ĠCluster Revision Ġfailure ", Ġex ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġshow Message ( msg : ĠString ) Ġ{ ĊĠĠĠ Ġrequire Activity (). run On Ui Thread Ġ{ ĊĠĠĠĠĠ Ġbasic Cluster Command Status . text Ġ= Ġmsg ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġsuspend Ġfun Ġget Basic Cluster For Device (): ĠBasic Cluster Ġ{ ĊĠĠĠ Ġreturn ĠBasic Cluster ( ĊĠĠĠĠĠ ĠCh ip Client . get Connected Device Pointer ( require Context (), Ġaddress Update Fragment . deviceId ), ĠEND POINT ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġprivate Ġconst Ġval ĠTAG Ġ= Ġ" Basic Client Fragment " ĊĠĠĠ Ġprivate Ġconst Ġval ĠEND POINT Ġ= Ġ 0 ĊĠĠĠ Ġprivate Ġval ĠATTRIBUT ES : ĠMutable List < String > Ġ= Ġmutable ListOf () ĊĊĠĠĠ Ġfun Ġnew Instance (): ĠBasic Client Fragment Ġ= ĠBasic Client Fragment () ĊĠ Ġ} Ċ } Ċ