package Ġorg . e health in novation . android . bluetooth . idd Ċ Ċ import Ġorg . e health in novation . android . bluetooth . idd . status reader control point . Get Active Bas al Rate Delivery Response Parser Ċ import Ġorg . e health in novation . android . bluetooth . idd . status reader control point . Get Counter Response Parser Ċ import Ġorg . e health in novation . android . bluetooth . idd . status reader control point . Get Deliver ed Ins ul in Response Parser Ċ import Ġorg . e health in novation . android . bluetooth . idd . status reader control point . Get Total Daily Ins ul in Status Response Parser Ċ import Ġorg . e health in novation . android . bluetooth . idd . status reader control point . Active B ol us Delivery Response Parser Ċ import Ġorg . e health in novation . android . bluetooth . parser .* Ċ Ċ class ĠI dd Status Reader ControlPoint Parser Ġ: ĠCharacter istic Parser < Status Reader Control Response > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġcan Parse ( packet : ĠCharacter istic Packet ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpacket . uuid Ġ== ĠI dd Uuid . STATUS _ READ ER _ CONTROL _ POINT . uuid ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġparse ( packet : ĠCharacter istic Packet ): ĠStatus Reader Control Response Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= Ġpacket . read Data () ĊĠĠĠĠĠĠĠ Ġval Ġopcode Ġ= Ġread Enumeration ( data . getNext Int ( Int Format . FORMAT _ UINT 1 6 ), ĠStatus Reader Control Opcode :: class . java , ĠStatus Reader Control Opcode . RESERVED _ FOR _ F UT URE _ USE ) ĊĠĠĠĠĠĠĠ Ġreturn Ġwhen Ġ( opcode ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠStatus Reader Control Opcode . RESPONSE _ CODE Ġ-> Ġread General Response ( data ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠStatus Reader Control Opcode . GET _ ACTIVE _ B OL US _ IDS _ RESPONSE Ġ-> Ġread Active B ol us Ids Response ( data ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠStatus Reader Control Opcode . GET _ COUNTER _ RESPONSE Ġ-> Ġread Get Counter Response ( data ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠStatus Reader Control Opcode . GET _ DE LI VER ED _ INS UL IN _ RESPONSE Ġ-> Ġread Get Ins ul in Deliver ed Response ( data ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠStatus Reader Control Opcode . GET _ ACTIVE _ BAS AL _ RATE _ DE LI VERY _ RESPONSE Ġ-> Ġread Get Active Bas al Delivery Res po onse ( data ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠStatus Reader Control Opcode . GET _ TOTAL _ DA IL Y _ INS UL IN _ STATUS _ RESPONSE Ġ-> Ġread Get Total Daily Ins u in Status Response ( data ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠStatus Reader Control Opcode . GET _ ACTIVE _ B OL US _ DE LI VERY _ RESPONSE Ġ-> Ġread Active B ol us Delivery Response ( data ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġ-> Ġthrow ĠIllegalArgumentException (" Opcode Ġ$ opcode Ġnot Ġsupported Ġby Ġthis Ġparser ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinternal Ġfun Ġread General Response ( data : ĠData Reader ): ĠStatus Reader Control General Response Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Opcode Ġ= Ġread Enumeration ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdata . getNext Int ( Int Format . FORMAT _ UINT 1 6 ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠStatus Reader Control Opcode :: class . java , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠStatus Reader Control Opcode . RESERVED _ FOR _ F UT URE _ USE ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġval Ġresponse Code Ġ= Ġread Enumeration ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdata . getNext Int ( Int Format . FORMAT _ UINT 8 ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠStatus Reader Control Response Code :: class . java , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠStatus Reader Control Response Code . RESERVED _ FOR _ F UT URE _ USE ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġreturn ĠStatus Reader Control General Response ( request Opcode , Ġresponse Code ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinternal Ġfun Ġread Active B ol us Ids Response ( data : ĠData Reader ): ĠActive B ol us Ids Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠnumberOf Active B ol us Ids Ġ= Ġdata . getNext Int ( Int Format . FORMAT _ UINT 8 ) ĊĠĠĠĠĠĠĠ Ġval Ġoutput Ids Ġ= Ġarray ListOf < Int >() ĊĠĠĠĠĠĠĠ Ġfor Ġ( i Ġin Ġ 1 .. numberOf Active B ol us Ids ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoutput Ids . add ( data . getNext Int ( Int Format . FORMAT _ UINT 1 6 )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn ĠActive B ol us Ids ( output Ids ) ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġinternal Ġfun Ġread Get Counter Response ( data : ĠData Reader ): ĠCounter Response Ġ= ĠGet Counter Response Parser (). parse Response ( data ) ĊĊĠĠĠ Ġinternal Ġfun Ġread Get Ins ul in Deliver ed Response ( data : ĠData Reader ): ĠDel iver ed Ins ul in Response Ġ= ĠGet Deliver ed Ins ul in Response Parser (). parse Response ( data ) ĊĊĠĠĠ Ġinternal Ġfun Ġread Get Total Daily Ins u in Status Response ( data : ĠData Reader ): ĠTotal Daily Ins ul in Status Response Ġ= ĠGet Total Daily Ins ul in Status Response Parser (). parse Response ( data ) ĊĊĠĠĠ Ġinternal Ġfun Ġread Active B ol us Delivery Response ( data : ĠData Reader ): ĠActive B ol us Delivery Response Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠActive B ol us Delivery Response Parser (). read Get Active B ol us Delivery Response ( data ) ĊĊĊĠĠĠ Ġinternal Ġfun Ġread Get Active Bas al Delivery Res po onse ( data : ĠData Reader ) Ġ: ĠActive Bas al Rate Delivery Response Ġ= ĠGet Active Bas al Rate Delivery Response Parser (). read Active Bas al Rate Delivery Response ( data ) Ċ Ċ }