fn notify_response(&mut self, resp: Result<Vec<u8, BUF_LEN>, InternalError>) {
        #[cfg(any(feature = "defmt", feature = "log"))]
        match &resp {
            Ok(r) => {
                if r.is_empty() {
                    debug!("Received OK")
                } else {
                    debug!("Received response: \"{:?}\"", LossyStr(r.as_ref()));
                }
            }
            Err(e) => {
                error!("Received error response {:?}", e);
            }
        };

        let (header, bytes) = ResponseHeader::as_bytes(&resp);
        if let Ok(mut grant) = self.res_p.grant(bytes.len() + header.len()) {
            grant[0..header.len()].copy_from_slice(&header);
            grant[header.len()..header.len() + bytes.len()].copy_from_slice(bytes);
            grant.commit(bytes.len() + header.len());
        } else {
            // FIXME: Handle queue being full
            error!("Response queue full!");
        }
    }
/// Notify the client that an appropriate response code, or error has been
/// received
Notify the client that an appropriate response code, or error has been
received
Notify the client that an appropriate response code or error has been received
fn notify_response(&mut self, resp: Result<Vec<u8, BUF_LEN>, InternalError>) {
        #[cfg(any(feature = "defmt", feature = "log"))]
        match &resp {
            Ok(r) => {
                if r.is_empty() {
                    debug!("Received OK")
                } else {
                    debug!("Received response: \"{:?}\"", LossyStr(r.as_ref()));
                }
            }
            Err(e) => {
                error!("Received error response {:?}", e);
            }
        };
        let (header, bytes) = ResponseHeader::as_bytes(&resp);
        if let Ok(mut grant) = self.res_p.grant(bytes.len() + header.len()) {
            grant[0..header.len()].copy_from_slice(&header);
            grant[header.len()..header.len() + bytes.len()].copy_from_slice(bytes);
            grant.commit(bytes.len() + header.len());
        } else {
            // FIXME: Handle queue being full
            error!("Response queue full!");
        }
    }
fn notify_response ( & mut self , resp : Result < Vec < u8 , BUF_LEN > , InternalError > ) { # [ cfg ( any ( feature " " feature " " ) ) ] match & resp { Ok ( r ) => { if r . is_empty ( ) { debug ! ( " " ) } else { debug ! ( " \" \" " LossyStr ( r as_ref ( ) ) ) ; } } Err ( e ) => { error ! ( " " e ) ; } } ; let ( header , bytes ) = ResponseHeader :: as_bytes ( & resp ) ; if let Ok ( mut grant ) = self . res_p . grant ( bytes . len ( ) + header . len ( ) ) { grant [ 0 .. header . len ( ) ] . copy_from_slice ( & header ) ; grant [ header . len ( ) .. header . len ( ) + bytes . len ( ) ] . copy_from_slice ( bytes ) ; grant . commit ( bytes . len ( ) + header . len ( ) ) ; } else { // FIXME: Handle queue being full error ! ( " " ) ; } }
Notify the client that an appropriate response code, or error has been
received
Notify the client that an appropriate response code or error has been received
&mut self
resp
Result<Vec<u8, BUF_LEN>, InternalError>
&mut self
resp
Result<Vec<u8, BUF_LEN>, InternalError>