9#ifndef ZEPHYR_INCLUDE_BLUETOOTH_OBEX_H_
10#define ZEPHYR_INCLUDE_BLUETOOTH_OBEX_H_
118#if defined(CONFIG_BT_OEBX_RSP_CODE_TO_STR)
123 ARG_UNUSED(rsp_code);
210#define BT_OBEX_SEND_BUF_RESERVE 7
1052#define BT_OBEX_CHALLENGE_TAG_NONCE 0x00
1058#define BT_OBEX_CHALLENGE_TAG_OPTIONS 0x01
1061#define BT_OBEX_CHALLENGE_TAG_OPTION_REQ_USER_ID BIT(0)
1063#define BT_OBEX_CHALLENGE_TAG_OPTION_ACCESS_MODE BIT(1)
1071#define BT_OBEX_CHALLENGE_TAG_REALM 0x02
1088#define BT_OBEX_RESPONSE_TAG_REQ_DIGEST 0x00
1094#define BT_OBEX_RESPONSE_TAG_USER_ID 0x01
1100#define BT_OBEX_RESPONSE_TAG_NONCE 0x02
1150 const uint8_t *session_param);
1233 bool (*func)(
struct bt_obex_hdr *hdr,
void *user_data),
void *user_data);
1381 bool (*func)(
struct bt_obex_tlv *tlv,
void *user_data),
void *user_data);
1457 const uint8_t **session_param);
long atomic_t
Definition atomic_types.h:15
int bt_obex_add_header_len(struct net_buf *buf, uint32_t len)
Add Header: the length of the object in bytes.
int bt_obex_add_header_wan_uuid(struct net_buf *buf, uint16_t len, const uint8_t *uuid)
Add Header: uniquely identifies the network client (OBEX server).
bt_obex_action_id
OBEX Actions.
Definition obex.h:792
int bt_obex_disconnect_rsp(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX disconnect response.
int bt_obex_add_header_creator_id(struct net_buf *buf, uint32_t creator_id)
Add Header: indicates the creator of an object.
int bt_obex_add_header_count(struct net_buf *buf, uint32_t count)
Add Header: number of objects (used by Connect)
int bt_obex_get_header_len(struct net_buf *buf, uint32_t *len)
Get header value: the length of the object in bytes.
int bt_obex_get_header_count(struct net_buf *buf, uint32_t *count)
Get header value: number of objects (used by Connect)
int bt_obex_connect(struct bt_obex *obex, uint16_t mopl, struct net_buf *buf)
OBEX connect request.
int bt_obex_get_header_conn_id(struct net_buf *buf, uint32_t *conn_id)
Get header value: an identifier used for OBEX connection multiplexing.
int bt_obex_add_header_srm(struct net_buf *buf, uint8_t srm)
Add Header: 1-byte value to setup Single Response Mode (SRM).
int bt_obex_add_header_time(struct net_buf *buf, uint32_t t)
Add Header: date/time stamp – 4 byte version (for compatibility only)
int bt_obex_action(struct bt_obex *obex, bool final, struct net_buf *buf)
OBEX action request.
int bt_obex_get_header_time(struct net_buf *buf, uint32_t *t)
Get header value: date/time stamp – 4 byte version (for compatibility only)
int bt_obex_add_header_action_id(struct net_buf *buf, uint32_t action_id)
Add Header: specifies the action to be performed (used in ACTION operation).
bt_obex_header_id
OBEX Header ID.
Definition obex.h:130
int bt_obex_get_header_description(struct net_buf *buf, uint16_t *len, const uint8_t **dec)
Get header value: text description of the object.
int bt_obex_add_header_dest_name(struct net_buf *buf, uint16_t len, const uint8_t *dest_name)
Add Header: the destination object name (used in certain ACTION operations).
int bt_obex_get_header_target(struct net_buf *buf, uint16_t *len, const uint8_t **target)
Get header value: name of service that operation is targeted to.
int bt_obex_get_header_obj_class(struct net_buf *buf, uint16_t *len, const uint8_t **obj_class)
Get header value: oBEX Object class of object.
int bt_obex_add_header_perm(struct net_buf *buf, uint32_t perm)
Add Header: 4-byte bit mask for setting permissions.
int bt_obex_setpath(struct bt_obex *obex, uint8_t flags, struct net_buf *buf)
OBEX setpath request.
int bt_obex_disconnect(struct bt_obex *obex, struct net_buf *buf)
OBEX disconnect request.
int bt_obex_add_header_auth_rsp(struct net_buf *buf, size_t count, const struct bt_obex_tlv data[])
Add Header: authentication digest-response.
int bt_obex_get_header_session_param(struct net_buf *buf, uint16_t *len, const uint8_t **session_param)
Get header value: parameters used in session commands/responses.
int bt_obex_add_header_who(struct net_buf *buf, uint16_t len, const uint8_t *who)
Add Header: identifies the OBEX application, used to tell if talking to a peer.
int bt_obex_get_header_http(struct net_buf *buf, uint16_t *len, const uint8_t **http)
Get header value: an HTTP 1.x header.
int bt_obex_header_parse(struct net_buf *buf, bool(*func)(struct bt_obex_hdr *hdr, void *user_data), void *user_data)
Helper for parsing OBEX header.
int bt_obex_get_header_action_id(struct net_buf *buf, uint32_t *action_id)
Get header value: specifies the action to be performed (used in ACTION operation).
bt_obex_state
Life-span states of OBEX.
Definition obex.h:439
int bt_obex_add_header_http(struct net_buf *buf, uint16_t len, const uint8_t *http)
Add Header: an HTTP 1.x header.
int bt_obex_get(struct bt_obex *obex, bool final, struct net_buf *buf)
OBEX get request.
int bt_obex_get_header_auth_challenge(struct net_buf *buf, uint16_t *len, const uint8_t **auth)
Get header value: authentication digest-challenge.
int bt_obex_add_header_obj_class(struct net_buf *buf, uint16_t len, const uint8_t *obj_class)
Add Header: OBEX Object class of object.
int bt_obex_get_header_srm_param(struct net_buf *buf, uint8_t *srm_param)
Get header value: Single Response Mode (SRM) Parameter.
static const char * bt_obex_rsp_code_to_str(enum bt_obex_rsp_code rsp_code)
Converts a OBEX response code to string.
Definition obex.h:121
int bt_obex_add_header_end_body(struct net_buf *buf, uint16_t len, const uint8_t *body)
Add Header: the final chunk of the object body.
bt_obex_rsp_code
OBEX Response Code.
Definition obex.h:29
int bt_obex_action_rsp(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX action response.
int bt_obex_add_header_time_iso_8601(struct net_buf *buf, uint16_t len, const uint8_t *t)
Add Header: date/time stamp – ISO 8601 version - preferred.
int bt_obex_get_header_dest_name(struct net_buf *buf, uint16_t *len, const uint8_t **dest_name)
Get header value: the destination object name (used in certain ACTION operations).
int bt_obex_get_header_app_param(struct net_buf *buf, uint16_t *len, const uint8_t **app_param)
Get header value: extended application request & response information.
int bt_obex_add_header_name(struct net_buf *buf, uint16_t len, const uint8_t *name)
Add Header: name of the object (often a file name)
int bt_obex_get_header_creator_id(struct net_buf *buf, uint32_t *creator_id)
Get header value: indicates the creator of an object.
int bt_obex_get_header_session_seq_number(struct net_buf *buf, uint32_t *session_seq_number)
Get header value: sequence number used in each OBEX packet for reliability.
int bt_obex_add_header_srm_param(struct net_buf *buf, uint8_t srm_param)
Add Header: Single Response Mode (SRM) Parameter.
int bt_obex_get_header_perm(struct net_buf *buf, uint32_t *perm)
Get header value: 4-byte bit mask for setting permissions.
int bt_obex_get_header_who(struct net_buf *buf, uint16_t *len, const uint8_t **who)
Get header value: identifies the OBEX application, used to tell if talking to a peer.
int bt_obex_get_header_body(struct net_buf *buf, uint16_t *len, const uint8_t **body)
Get header value: a chunk of the object body.
int bt_obex_get_header_type(struct net_buf *buf, uint16_t *len, const uint8_t **type)
Get header value: type of object - e.g.
int bt_obex_get_header_name(struct net_buf *buf, uint16_t *len, const uint8_t **name)
Get header value: name of the object (often a file name)
int bt_obex_setpath_rsp(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX setpath response.
int bt_obex_add_header_session_param(struct net_buf *buf, uint16_t len, const uint8_t *session_param)
Add Header: parameters used in session commands/responses.
int bt_obex_add_header_target(struct net_buf *buf, uint16_t len, const uint8_t *target)
Add Header: name of service that operation is targeted to.
int bt_obex_tlv_parse(uint16_t len, const uint8_t *data, bool(*func)(struct bt_obex_tlv *tlv, void *user_data), void *user_data)
Helper for parsing OBEX TLV triplet.
int bt_obex_connect_rsp(struct bt_obex *obex, uint8_t rsp_code, uint16_t mopl, struct net_buf *buf)
OBEX connect response.
int bt_obex_get_header_time_iso_8601(struct net_buf *buf, uint16_t *len, const uint8_t **t)
Get header value: date/time stamp – ISO 8601 version - preferred.
int bt_obex_add_header_auth_challenge(struct net_buf *buf, size_t count, const struct bt_obex_tlv data[])
Add Header: authentication digest-challenge.
int bt_obex_add_header_body(struct net_buf *buf, uint16_t len, const uint8_t *body)
Add Header: a chunk of the object body.
int bt_obex_add_header_session_seq_number(struct net_buf *buf, uint32_t session_seq_number)
Add Header: sequence number used in each OBEX packet for reliability.
int bt_obex_abort_rsp(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX abort response.
int bt_obex_put(struct bt_obex *obex, bool final, struct net_buf *buf)
OBEX put request.
int bt_obex_get_header_auth_rsp(struct net_buf *buf, uint16_t *len, const uint8_t **auth)
Get header value: authentication digest-response.
int bt_obex_add_header_conn_id(struct net_buf *buf, uint32_t conn_id)
Add Header: an identifier used for OBEX connection multiplexing.
int bt_obex_add_header_type(struct net_buf *buf, uint16_t len, const uint8_t *type)
Add Header: type of object - e.g.
int bt_obex_abort(struct bt_obex *obex, struct net_buf *buf)
OBEX abort request.
int bt_obex_get_header_srm(struct net_buf *buf, uint8_t *srm)
Get header value: 1-byte value to setup Single Response Mode (SRM).
int bt_obex_add_header_app_param(struct net_buf *buf, size_t count, const struct bt_obex_tlv data[])
Add Header: extended application request & response information.
int bt_obex_add_header_description(struct net_buf *buf, uint16_t len, const uint8_t *dec)
Add Header: text description of the object.
int bt_obex_put_rsp(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX put response.
int bt_obex_get_rsp(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX get response.
int bt_obex_get_header_end_body(struct net_buf *buf, uint16_t *len, const uint8_t **body)
Get header value: the final chunk of the object body.
int bt_obex_get_header_wan_uuid(struct net_buf *buf, uint16_t *len, const uint8_t **uuid)
Get header value: uniquely identifies the network client (OBEX server).
@ BT_OBEX_ACTION_SET_PERM
Set Object Permissions Action.
Definition obex.h:798
@ BT_OBEX_ACTION_MOVE_RENAME
Move/Rename Object Action.
Definition obex.h:796
@ BT_OBEX_ACTION_COPY
Copy Object Action.
Definition obex.h:794
@ BT_OBEX_HEADER_ID_ACTION_ID
Specifies the action to be performed (used in ACTION operation).
Definition obex.h:195
@ BT_OBEX_HEADER_ID_DES
Text description of the object.
Definition obex.h:150
@ BT_OBEX_HEADER_ID_CREATE_ID
Indicates the creator of an object.
Definition obex.h:180
@ BT_OBEX_HEADER_ID_BODY
A chunk of the object body.
Definition obex.h:159
@ BT_OBEX_HEADER_ID_CONN_ID
An identifier used for OBEX connection multiplexing.
Definition obex.h:168
@ BT_OBEX_HEADER_ID_SESSION_SEQ_NUM
Sequence number used in each OBEX packet for reliability.
Definition obex.h:192
@ BT_OBEX_HEADER_ID_HTTP
An HTTP 1.x header.
Definition obex.h:156
@ BT_OBEX_HEADER_ID_TIME
Date/time stamp – 4 byte version (for compatibility only)
Definition obex.h:147
@ BT_OBEX_HEADER_ID_TARGET
Name of service that operation is targeted to.
Definition obex.h:153
@ BT_OBEX_HEADER_ID_OBJECT_CLASS
OBEX Object class of object.
Definition obex.h:186
@ BT_OBEX_HEADER_ID_COUNT
Number of objects (used by Connect)
Definition obex.h:132
@ BT_OBEX_HEADER_ID_WAN_UUID
Uniquely identifies the network client (OBEX server).
Definition obex.h:183
@ BT_OBEX_HEADER_ID_PERM
4-byte bit mask for setting permissions.
Definition obex.h:201
@ BT_OBEX_HEADER_ID_APP_PARAM
Extended application request & response information.
Definition obex.h:171
@ BT_OBEX_HEADER_ID_TYPE
Type of object - e.g.
Definition obex.h:138
@ BT_OBEX_HEADER_ID_AUTH_RSP
Authentication digest-response.
Definition obex.h:177
@ BT_OBEX_HEADER_ID_AUTH_CHALLENGE
Authentication digest-challenge.
Definition obex.h:174
@ BT_OBEX_HEADER_ID_SRM
1-byte value to setup Single Response Mode (SRM).
Definition obex.h:204
@ BT_OBEX_HEADER_ID_END_BODY
The final chunk of the object body.
Definition obex.h:162
@ BT_OBEX_HEADER_ID_WHO
Identifies the OBEX application, used to tell if talking to a peer.
Definition obex.h:165
@ BT_OBEX_HEADER_ID_TIME_ISO_8601
Date/time stamp – ISO 8601 version - preferred.
Definition obex.h:144
@ BT_OBEX_HEADER_ID_SRM_PARAM
1-byte value for setting parameters used during Single Response Mode (SRM).
Definition obex.h:207
@ BT_OBEX_HEADER_ID_NAME
Name of the object (often a file name)
Definition obex.h:135
@ BT_OBEX_HEADER_ID_LEN
The length of the object in bytes.
Definition obex.h:141
@ BT_OBEX_HEADER_ID_DEST_NAME
The destination object name (used in certain ACTION operations).
Definition obex.h:198
@ BT_OBEX_HEADER_ID_SESSION_PARAM
Parameters used in session commands/responses.
Definition obex.h:189
@ BT_OBEX_CONNECTED
OBEX ready for upper layer traffic on it.
Definition obex.h:445
@ BT_OBEX_CONNECTING
OBEX in connecting state.
Definition obex.h:443
@ BT_OBEX_DISCONNECTED
OBEX disconnected.
Definition obex.h:441
@ BT_OBEX_DISCONNECTING
OBEX in disconnecting state.
Definition obex.h:447
@ BT_OBEX_RSP_CODE_ENTITY_TOO_LARGE
Requested Entity Too Large.
Definition obex.h:87
@ BT_OBEX_RSP_CODE_NOT_FOUND
Not Found.
Definition obex.h:69
@ BT_OBEX_RSP_CODE_BAD_REQ
Bad Request - server couldn’t understand request.
Definition obex.h:61
@ BT_OBEX_RSP_CODE_NON_AUTH_INFO
Non-Authoritative Information
Definition obex.h:41
@ BT_OBEX_RSP_CODE_NO_CONTENT
No Content.
Definition obex.h:43
@ BT_OBEX_RSP_CODE_MULTI_CHOICES
Multiple Choices.
Definition obex.h:49
@ BT_OBEX_RSP_CODE_NOT_ALLOW
Method Not Allowed.
Definition obex.h:71
@ BT_OBEX_RSP_CODE_REQ_TIMEOUT
Request Time Out.
Definition obex.h:77
@ BT_OBEX_RSP_CODE_NOT_ACCEPT
Not Acceptable.
Definition obex.h:73
@ BT_OBEX_RSP_CODE_FORBIDDEN
Forbidden - operation is understood but refused.
Definition obex.h:67
@ BT_OBEX_RSP_CODE_RESET_CONTENT
Reset Content.
Definition obex.h:45
@ BT_OBEX_RSP_CODE_DB_LOCK
Database Locked.
Definition obex.h:107
@ BT_OBEX_RSP_CODE_PAY_REQ
Payment Required.
Definition obex.h:65
@ BT_OBEX_RSP_CODE_UNAVAIL
Service Unavailable.
Definition obex.h:99
@ BT_OBEX_RSP_CODE_UNSUPP_MEDIA_TYPE
Unsupported media type.
Definition obex.h:91
@ BT_OBEX_RSP_CODE_CONTINUE
Continue.
Definition obex.h:31
@ BT_OBEX_RSP_CODE_GATEWAY_TIMEOUT
Gateway Timeout.
Definition obex.h:101
@ BT_OBEX_RSP_CODE_OK
OK.
Definition obex.h:33
@ BT_OBEX_RSP_CODE_CREATED
Created.
Definition obex.h:37
@ BT_OBEX_RSP_CODE_GONE
Gone.
Definition obex.h:81
@ BT_OBEX_RSP_CODE_MOVED_PERM
Moved Permanently.
Definition obex.h:51
@ BT_OBEX_RSP_CODE_PRECON_FAIL
Precondition Failed.
Definition obex.h:85
@ BT_OBEX_RSP_CODE_NOT_MODIFIED
Not modified.
Definition obex.h:57
@ BT_OBEX_RSP_CODE_VER_UNSUPP
HTTP Version not supported.
Definition obex.h:103
@ BT_OBEX_RSP_CODE_ACCEPTED
Accepted.
Definition obex.h:39
@ BT_OBEX_RSP_CODE_NOT_IMPL
Not Implemented.
Definition obex.h:95
@ BT_OBEX_RSP_CODE_MOVED_TEMP
Moved temporarily.
Definition obex.h:53
@ BT_OBEX_RSP_CODE_LEN_REQ
Length Required.
Definition obex.h:83
@ BT_OBEX_RSP_CODE_USE_PROXY
Use Proxy.
Definition obex.h:59
@ BT_OBEX_RSP_CODE_SEE_OTHER
See Other.
Definition obex.h:55
@ BT_OBEX_RSP_CODE_BAD_GATEWAY
Bad Gateway.
Definition obex.h:97
@ BT_OBEX_RSP_CODE_UNAUTH
Unauthorized.
Definition obex.h:63
@ BT_OBEX_RSP_CODE_DB_FULL
Database Full.
Definition obex.h:105
@ BT_OBEX_RSP_CODE_URL_TOO_LARGE
Requested URL Too Large.
Definition obex.h:89
@ BT_OBEX_RSP_CODE_INTER_ERROR
Internal serve Error.
Definition obex.h:93
@ BT_OBEX_RSP_CODE_PROXY_AUTH_REQ
Proxy Authentication Required.
Definition obex.h:75
@ BT_OBEX_RSP_CODE_CONFLICT
Conflict.
Definition obex.h:79
@ BT_OBEX_RSP_CODE_SUCCESS
Success.
Definition obex.h:35
@ BT_OBEX_RSP_CODE_PARTIAL_CONTENT
Partial Content.
Definition obex.h:47
flags
Definition parser.h:97
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
OBEX client operations structure.
Definition obex.h:300
void(* get)(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX get response callback.
Definition obex.h:346
void(* connect)(struct bt_obex *obex, uint8_t rsp_code, uint8_t version, uint16_t mopl, struct net_buf *buf)
OBEX connect response callback.
Definition obex.h:312
void(* disconnect)(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX disconnect response callback.
Definition obex.h:324
void(* put)(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX put response callback.
Definition obex.h:335
void(* abort)(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX abort response callback.
Definition obex.h:357
void(* setpath)(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX SetPath response callback.
Definition obex.h:368
void(* action)(struct bt_obex *obex, uint8_t rsp_code, struct net_buf *buf)
OBEX action response callback.
Definition obex.h:379
OBEX Header structure.
Definition obex.h:1208
uint16_t len
The length of header value.
Definition obex.h:1212
uint8_t id
Header ID bt_obex_header_id.
Definition obex.h:1210
const uint8_t * data
Header value.
Definition obex.h:1214
OBEX server operations structure.
Definition obex.h:218
void(* abort)(struct bt_obex *obex, struct net_buf *buf)
OBEX abort request callback.
Definition obex.h:271
void(* connect)(struct bt_obex *obex, uint8_t version, uint16_t mopl, struct net_buf *buf)
OBEX connect request callback.
Definition obex.h:229
void(* disconnect)(struct bt_obex *obex, struct net_buf *buf)
OBEX disconnect request callback.
Definition obex.h:239
void(* put)(struct bt_obex *obex, bool final, struct net_buf *buf)
OBEX put request callback.
Definition obex.h:250
void(* setpath)(struct bt_obex *obex, uint8_t flags, struct net_buf *buf)
OBEX SetPath request callback.
Definition obex.h:282
void(* get)(struct bt_obex *obex, bool final, struct net_buf *buf)
OBEX get request callback.
Definition obex.h:261
void(* action)(struct bt_obex *obex, bool final, struct net_buf *buf)
OBEX action request callback.
Definition obex.h:293
Bluetooth OBEX TLV triplet.
Definition obex.h:1031
const uint8_t * data
Definition obex.h:1034
uint8_t type
Definition obex.h:1032
uint8_t data_len
Definition obex.h:1033
OBEX transport operations structure.
Definition obex.h:386
int(* send)(struct bt_obex *obex, struct net_buf *buf)
Send OBEX data via transport.
Definition obex.h:409
int(* disconnect)(struct bt_obex *obex)
Disconnect from transport.
Definition obex.h:419
OBEX structure.
Definition obex.h:451
const struct bt_obex_client_ops * client_ops
OBEX Client operations.
Definition obex.h:464
uint16_t mopl
The Maximum OBEX Packet Length (MOPL)
Definition obex.h:470
uint16_t mtu
MTU of OBEX transport.
Definition obex.h:468
const struct bt_obex_server_ops * server_ops
OBEX Server operations.
Definition obex.h:457
Network buffer pool representation.
Definition net_buf.h:1079
Network buffer representation.
Definition net_buf.h:1006
Binary representation of a UUID.
Definition uuid.h:48