obex: collect obex related structures used by BTstack

This commit is contained in:
Matthias Ringwald 2024-07-17 15:33:52 +02:00
parent 7b3c482790
commit d3eadd6deb
3 changed files with 37 additions and 39 deletions

View File

@ -52,6 +52,7 @@
#include "btstack_linked_list.h"
#include "classic/obex_parser.h"
#include "l2cap.h"
#include "obex.h"
#if defined __cplusplus
extern "C" {
@ -83,13 +84,6 @@ typedef struct {
uint8_t srmp_value;
} avrcp_cover_art_obex_srm_t;
typedef enum {
SRM_DISABLED,
SRM_W4_CONFIRM,
SRM_ENABLED_BUT_WAITING,
SRM_ENABLED
} avrcp_cover_art_srm_state_t;
typedef struct {
btstack_linked_item_t item;
@ -120,7 +114,7 @@ typedef struct {
// obex srm
avrcp_cover_art_obex_srm_t obex_srm;
avrcp_cover_art_srm_state_t srm_state;
obex_srm_state_t srm_state;
// request
const char * object_type;

View File

@ -38,6 +38,8 @@
#ifndef OBEX_H
#define OBEX_H
#include <stdint.h>
// From IR OBEX V1.5 - some opcodes have high bit always set
#define OBEX_OPCODE_CONNECT 0x80
#define OBEX_OPCODE_DISCONNECT 0x81
@ -146,4 +148,36 @@
// PbapSupportedFeatures - 0x10 - 4 bytes
#define PBAP_APPLICATION_PARAMETER_PBAP_SUPPORTED_FEATURES 0x10
// OBEX related structs used by BTstack
typedef enum {
SRM_DISABLED,
SRM_W4_CONFIRM,
SRM_ENABLED_BUT_WAITING,
SRM_ENABLED
} obex_srm_state_t;
typedef enum {
OBEX_AUTH_PARSER_STATE_W4_TYPE = 0,
OBEX_AUTH_PARSER_STATE_W4_LEN,
OBEX_AUTH_PARSER_STATE_W4_VALUE,
OBEX_AUTH_PARSER_STATE_INVALID,
} obex_auth_parser_state_t;
typedef struct {
// parsing
obex_auth_parser_state_t state;
uint8_t type;
uint8_t len;
uint8_t pos;
// data
uint8_t authentication_options;
uint16_t authentication_nonce[16];
} obex_auth_parser_t;
typedef struct {
uint8_t srm_value;
uint8_t srmp_value;
} obex_srm_t;
#endif

View File

@ -102,36 +102,6 @@ typedef enum {
} pbap_state_t;
typedef enum {
SRM_DISABLED,
SRM_W4_CONFIRM,
SRM_ENABLED_BUT_WAITING,
SRM_ENABLED
} srm_state_t;
typedef enum {
OBEX_AUTH_PARSER_STATE_W4_TYPE = 0,
OBEX_AUTH_PARSER_STATE_W4_LEN,
OBEX_AUTH_PARSER_STATE_W4_VALUE,
OBEX_AUTH_PARSER_STATE_INVALID,
} obex_auth_parser_state_t;
typedef struct {
// parsing
obex_auth_parser_state_t state;
uint8_t type;
uint8_t len;
uint8_t pos;
// data
uint8_t authentication_options;
uint16_t authentication_nonce[16];
} obex_auth_parser_t;
typedef struct {
uint8_t srm_value;
uint8_t srmp_value;
} obex_srm_t;
typedef enum {
PBAP_CLIENT_PHONEBOOK_SIZE_PARSER_STATE_W4_TYPE = 0,
PBAP_CLIENT_PHONEBOOK_SIZE_PARSER_STATE_W4_LEN,
@ -198,7 +168,7 @@ typedef struct pbap_client {
bool flow_wait_for_user;
/* srm */
obex_srm_t obex_srm;
srm_state_t srm_state;
obex_srm_state_t srm_state;
} pbap_client_t;
static uint32_t pbap_client_supported_features;