File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -120,11 +120,11 @@ impl Device {
120120 Ok ( ( ) )
121121 }
122122
123- pub async fn poll ( & mut self ) -> Result < Card < ' _ > , Error > {
123+ pub async fn poll ( & mut self ) -> Result < Option < Card < ' _ > > , Error > {
124124 let res = self . pn53x_cmd ( 0x4a , & [ 0x01 , 0x00 ] ) . await ?;
125125
126126 if res[ 0 ] != 0x01 {
127- return Err ( Error :: other ( "no card present" ) ) ;
127+ return Ok ( None ) ;
128128 }
129129 assert ! ( res[ 1 ] == 0x01 ) ;
130130
@@ -140,13 +140,13 @@ impl Device {
140140 trace ! ( "uid: {:02x?}" , uid) ;
141141 trace ! ( "ats: {:02x?}" , ats) ;
142142
143- Ok ( Card {
143+ Ok ( Some ( Card {
144144 dev : self ,
145145 atqa,
146146 sak,
147147 uid,
148148 ats,
149- } )
149+ } ) )
150150 }
151151
152152 async fn pn53x_cmd ( & mut self , code : u8 , data : & [ u8 ] ) -> Result < Vec < u8 > , Error > {
You can’t perform that action at this time.
0 commit comments