mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-03 23:47:08 +00:00
obex_srm_client: split init, add srm_is_active
This commit is contained in:
parent
50c752545e
commit
30f40b4a93
@ -45,6 +45,10 @@
|
||||
|
||||
void obex_srm_client_init(obex_srm_client_t * obex_srm){
|
||||
obex_srm->srm_state = OBEX_SRM_CLIENT_STATE_DISABLED;
|
||||
obex_srm_client_reset_fields(obex_srm);
|
||||
}
|
||||
|
||||
void obex_srm_client_reset_fields(obex_srm_client_t * obex_srm){
|
||||
obex_srm->srm_value = OBEX_SRM_DISABLE;
|
||||
obex_srm->srmp_value = OBEX_SRMP_NEXT;
|
||||
}
|
||||
@ -91,3 +95,7 @@ void obex_srm_client_prepare_header(obex_srm_client_t *obex_srm, uint16_t goep_c
|
||||
obex_srm->srm_state = OBEX_SRM_CLIENT_STATE_W4_CONFIRM;
|
||||
}
|
||||
}
|
||||
|
||||
bool obex_srm_client_is_srm_active(obex_srm_client_t *obex_srm){
|
||||
return obex_srm->srm_state == OBEX_SRM_CLIENT_STATE_ENABLED;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@
|
||||
#define OBEX_SRM_CLIENT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "btstack_bool.h"
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C" {
|
||||
@ -59,17 +60,31 @@ typedef struct {
|
||||
} obex_srm_client_t;
|
||||
|
||||
/**
|
||||
* Init SRM state
|
||||
* Init SRM to disabled state
|
||||
* SRM needs to be disabled for each new GET/PUT operation
|
||||
* @param obex_srm
|
||||
*/
|
||||
void obex_srm_client_init(obex_srm_client_t * obex_srm);
|
||||
|
||||
/**
|
||||
* Reset SRM/SRMP fields
|
||||
* Needs to be called before parsing response
|
||||
* @param obex_srm
|
||||
*/
|
||||
void obex_srm_client_reset_fields(obex_srm_client_t * obex_srm);
|
||||
|
||||
/**
|
||||
* Update SRM state based on SRM headers
|
||||
* @param obex_srm
|
||||
*/
|
||||
void obex_srm_client_handle_headers(obex_srm_client_t *obex_srm);
|
||||
|
||||
/**
|
||||
* Check if SRM is active
|
||||
* @param obex_srm
|
||||
*/
|
||||
bool obex_srm_client_is_srm_active(obex_srm_client_t *obex_srm);
|
||||
|
||||
/**
|
||||
* Add SRM headers if
|
||||
* @param obex_srm
|
||||
|
Loading…
Reference in New Issue
Block a user