Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
module Status : sig ... end
module Header : sig ... end
type error =
| AppError of {
status : Status.t;
msg : string;
}
| ApduError of Header.Error.t
| TransportError of transport_error
val pp_error : Stdlib.Format.formatter -> error -> unit
val write_apdu :
?pp:Stdlib.Format.formatter ->
?buf:Cstruct.t ->
Hidapi.t ->
Apdu.t ->
(unit, error) Stdlib.result
write_apdu ?pp ?buf ledger apdu
writes apdu
to ledger
.
val read :
?pp:Stdlib.Format.formatter ->
?buf:Cstruct.t ->
Hidapi.t ->
(Status.t * Cstruct.t, error) Stdlib.result
read ?pp ?buf ledger
reads from ledger
a status response and a payload.
ping ?pp ?buf ledger
writes a ping packet to ledger
, optionally containing buf
.
val apdu :
?pp:Stdlib.Format.formatter ->
?msg:string ->
?buf:Cstruct.t ->
Hidapi.t ->
Apdu.t ->
(Cstruct.t, error) Stdlib.result
apdu ?pp ?msg ?buf ledger apdu
writes apdu
to ledger
and returns the response.
val write_payload :
?pp:Stdlib.Format.formatter ->
?msg:string ->
?buf:Cstruct.t ->
?mark_last:bool ->
cmd:Apdu.cmd ->
?p1:int ->
?p2:int ->
Hidapi.t ->
Cstruct.t ->
(Cstruct.t, error) Stdlib.result
write_payload ?pp ?msg ?buf ?mark_last ~cmd ?p1 ?p2 ledger
payload
writes the payload
of cmd
into ledger
and returns the response.