package coap-core

  1. Overview
  2. Docs

Module Coap_core.MessageSource

Sourcetype t
Sourcetype kind =
  1. | Confirmable
  2. | Nonconfirmable
  3. | Acknowledgement
  4. | Reset
Sourcetype code =
  1. | Empty
  2. | Request of [ `Get | `Post | `Put | `Delete ]
  3. | Response of [ `Created | `Deleted | `Valid | `Changed | `Content | `Bad_request | `Unauthorized | `Bad_option | `Forbidden | `Not_found | `Method_not_allowed | `Not_acceptable | `Precondition_failed | `Request_entity_too_large | `Unsupported_content_format | `Internal_server_error | `Not_implemented | `Bad_gateway | `Service_unavailable | `Gateway_timeout | `Proxying_not_supported ]
Sourceval pp_code : Format.formatter -> code -> unit
Sourcetype content_format = [
  1. | `Text of [ `Plain ]
  2. | `Application of [ `Link_format | `Xml | `Octet_stream | `Exi | `Json | `Cbor ]
]
Sourcetype option =
  1. | If_match of string
  2. | Uri_host of string
  3. | Etag of string
  4. | If_none_match
  5. | Uri_port of int
  6. | Location_path of string
  7. | Uri_path of string
  8. | Content_format of content_format
  9. | Max_age of int
  10. | Uri_query of string
  11. | Accept of int
  12. | Location_query of string
  13. | Proxy_uri of string
  14. | Proxy_scheme of string
  15. | Size1 of int
Sourceval make : ?version:int -> ?id:int -> ?token:string -> code:code -> ?kind:kind -> ?options:option list -> ?client_addr:string -> buffer -> t

Coap message constructor.

Sourceval version : t -> int
Sourceval id : t -> int
Sourceval kind : t -> kind
Sourceval code : t -> code
Sourceval token : t -> string

Message token used to match a response with a request.

Token values may be 0 to 8 bytes in length.

Sourceval options : t -> option list
Sourceval path : t -> string list

Extract request path from message options.

Sourceval client_addr : t -> string Option.t
Sourceval with_client_addr : string Option.t -> t -> t
Sourceval payload : t -> buffer
Sourceval payload_length : t -> int
Sourceval buffer_to_string : buffer -> string
Sourceval buffer_of_string : string -> buffer
Sourceval is_confirmable : t -> bool
Sourceval decode : buffer -> (t, error) result
Sourceval encode : t -> buffer
Sourceval pp : Format.formatter -> t -> unit
Sourceval max_size : int

Maximum safe message size.

https://tools.ietf.org/html/rfc7252#section-4.6

OCaml

Innovation. Community. Security.