xref: /aosp_15_r20/system/chre/chpp/RELEASE_NOTES.md (revision 84e339476a462649f82315436d70fd732297a399)
1*84e33947SAndroid Build Coastguard Worker# CHPP Release Notes
2*84e33947SAndroid Build Coastguard Worker
3*84e33947SAndroid Build Coastguard WorkerA summary of notable changes is provided in the form of release notes. Dates are provided as yyyy-mm-dd. Note that this is not meant to be a detailed changelog; for a detailed change list, please refer to git commits.
4*84e33947SAndroid Build Coastguard Worker
5*84e33947SAndroid Build Coastguard Worker### 2020-03-04 (4c668b3)
6*84e33947SAndroid Build Coastguard Worker
7*84e33947SAndroid Build Coastguard WorkerInitial release of CHPP.
8*84e33947SAndroid Build Coastguard Worker
9*84e33947SAndroid Build Coastguard Worker- CHPP transport and app layers
10*84e33947SAndroid Build Coastguard Worker- Loopback testing service
11*84e33947SAndroid Build Coastguard Worker
12*84e33947SAndroid Build Coastguard Worker### 2020-07-28 (7cebe57)
13*84e33947SAndroid Build Coastguard Worker
14*84e33947SAndroid Build Coastguard WorkerThis release enables service integration with WWAN / WiFi / GNSS devices based on the CHRE PAL API.
15*84e33947SAndroid Build Coastguard Worker
16*84e33947SAndroid Build Coastguard Worker- New functionality
17*84e33947SAndroid Build Coastguard Worker
18*84e33947SAndroid Build Coastguard Worker  - Reset and reset-ack implementation to allow either peer to initialize the other (e.g., upon boot)
19*84e33947SAndroid Build Coastguard Worker  - Discovery service to provide a list of services
20*84e33947SAndroid Build Coastguard Worker  - Discovery client to match clients with discovered services
21*84e33947SAndroid Build Coastguard Worker  - Standard WWAN service based on the CHRE PAL API
22*84e33947SAndroid Build Coastguard Worker  - Standard WiFi service based on the CHRE PAL API
23*84e33947SAndroid Build Coastguard Worker  - Standard GNSS service based on the CHRE PAL API
24*84e33947SAndroid Build Coastguard Worker  - Standard WWAN client based on the CHRE PAL API
25*84e33947SAndroid Build Coastguard Worker
26*84e33947SAndroid Build Coastguard Worker- Updates and bug fixes to existing layers, including
27*84e33947SAndroid Build Coastguard Worker
28*84e33947SAndroid Build Coastguard Worker  - Better logging to assist verification and debugging
29*84e33947SAndroid Build Coastguard Worker  - Error replies are sent over the wire for transport layer errors
30*84e33947SAndroid Build Coastguard Worker  - Over-the-wire preamble has been corrected (byte shifting error)
31*84e33947SAndroid Build Coastguard Worker
32*84e33947SAndroid Build Coastguard Worker- API and integration changes
33*84e33947SAndroid Build Coastguard Worker
34*84e33947SAndroid Build Coastguard Worker  - App layer header now includes an error code
35*84e33947SAndroid Build Coastguard Worker  - App layer message type now occupies only the least significant nibble (LSN). The most significant nibble (MSN) is reserved
36*84e33947SAndroid Build Coastguard Worker  - chppPlatformLinkSend() now returns an error code instead of a boolean
37*84e33947SAndroid Build Coastguard Worker  - Added initialization, deinitialization, and reset functionality for the link layer (see link.h)
38*84e33947SAndroid Build Coastguard Worker  - Condition variables functionality needs to be supported alongside other platform functionality (see chpp/platform/)
39*84e33947SAndroid Build Coastguard Worker  - Name changes for the logging APIs
40*84e33947SAndroid Build Coastguard Worker
41*84e33947SAndroid Build Coastguard Worker### 2020-08-07 (0b41306)
42*84e33947SAndroid Build Coastguard Worker
43*84e33947SAndroid Build Coastguard WorkerThis release contains bug fixes as well as the loopback client.
44*84e33947SAndroid Build Coastguard Worker
45*84e33947SAndroid Build Coastguard Worker- New functionality
46*84e33947SAndroid Build Coastguard Worker
47*84e33947SAndroid Build Coastguard Worker  - Loopback client to run and verify a loopback test using a provided data buffer
48*84e33947SAndroid Build Coastguard Worker
49*84e33947SAndroid Build Coastguard Worker- Cleanup and bug fixes
50*84e33947SAndroid Build Coastguard Worker
51*84e33947SAndroid Build Coastguard Worker  - Corrected sequence number handling
52*84e33947SAndroid Build Coastguard Worker  - Updated log messages
53*84e33947SAndroid Build Coastguard Worker  - More accurate casting into enums
54*84e33947SAndroid Build Coastguard Worker
55*84e33947SAndroid Build Coastguard Worker### 2020-08-27 (8ab5c23)
56*84e33947SAndroid Build Coastguard Worker
57*84e33947SAndroid Build Coastguard WorkerThis release contains additional clients, a virtual link layer for testing (e.g., using loopback), and several important bug fixes.
58*84e33947SAndroid Build Coastguard Worker
59*84e33947SAndroid Build Coastguard Worker- New functionality
60*84e33947SAndroid Build Coastguard Worker
61*84e33947SAndroid Build Coastguard Worker  - Basic implementation of the standard WiFi client based on the CHRE PAL API
62*84e33947SAndroid Build Coastguard Worker  - Basic implementation of the standard GNSS client based on the CHRE PAL API
63*84e33947SAndroid Build Coastguard Worker  - Virtual link layer that connects CHPP with itself on Linux to enable testing, including reset, discovery, and loopback
64*84e33947SAndroid Build Coastguard Worker
65*84e33947SAndroid Build Coastguard Worker- Cleanup and bug fixes
66*84e33947SAndroid Build Coastguard Worker
67*84e33947SAndroid Build Coastguard Worker  - Client implementation cleanup
68*84e33947SAndroid Build Coastguard Worker  - Client-side handling of close responses
69*84e33947SAndroid Build Coastguard Worker  - Reset / reset-ack handshaking mechanism fixed
70*84e33947SAndroid Build Coastguard Worker  - Loopback client fixed
71*84e33947SAndroid Build Coastguard Worker  - Enhanced log messages
72*84e33947SAndroid Build Coastguard Worker  - Service command #s are now sequential
73*84e33947SAndroid Build Coastguard Worker
74*84e33947SAndroid Build Coastguard Worker- API and integration changes
75*84e33947SAndroid Build Coastguard Worker
76*84e33947SAndroid Build Coastguard Worker  - Platform-specific time functionality (platform_time.h)
77*84e33947SAndroid Build Coastguard Worker
78*84e33947SAndroid Build Coastguard Worker### 2020-10-01 (95829e3)
79*84e33947SAndroid Build Coastguard Worker
80*84e33947SAndroid Build Coastguard WorkerThis release updates client functionality using the parser, adds a transport-layer loopback mechanism for testing and debugging, and includes several important bug fixes.
81*84e33947SAndroid Build Coastguard Worker
82*84e33947SAndroid Build Coastguard Worker- New functionality
83*84e33947SAndroid Build Coastguard Worker
84*84e33947SAndroid Build Coastguard Worker  - Parser for CHPP -> CHRE Data Structure Decoding
85*84e33947SAndroid Build Coastguard Worker  - Completed client functionality using parser-generated functions
86*84e33947SAndroid Build Coastguard Worker  - Transport-layer-loopback client and service. The Transport-layer loopback ignores app layer functionality and state, as well as checksums and sequence numbers
87*84e33947SAndroid Build Coastguard Worker
88*84e33947SAndroid Build Coastguard Worker- Cleanup and bug fixes
89*84e33947SAndroid Build Coastguard Worker
90*84e33947SAndroid Build Coastguard Worker  - Improved compiler compatibility for MSVC, as well as when enabling additional compiler warning flags
91*84e33947SAndroid Build Coastguard Worker  - Fixed handling of fragmented datagrams
92*84e33947SAndroid Build Coastguard Worker  - Corrected MTU calculation
93*84e33947SAndroid Build Coastguard Worker  - Corrected loopback assert
94*84e33947SAndroid Build Coastguard Worker  - Slimmer OOM logging
95*84e33947SAndroid Build Coastguard Worker  - Parser code and header files were relocated
96*84e33947SAndroid Build Coastguard Worker
97*84e33947SAndroid Build Coastguard Worker### 2021-02-08 (f1d249c)
98*84e33947SAndroid Build Coastguard Worker
99*84e33947SAndroid Build Coastguard WorkerIn addition to enhancements and bug fixes, this release enables error and reset handling and several other features.
100*84e33947SAndroid Build Coastguard Worker
101*84e33947SAndroid Build Coastguard Worker- New functionality
102*84e33947SAndroid Build Coastguard Worker
103*84e33947SAndroid Build Coastguard Worker  - ARQ implementation. Note that it is necessary to either implement chppNotifierTimedWait() or a single-threaded workaround as described in QUICKSTART.md to detect timeouts
104*84e33947SAndroid Build Coastguard Worker  - Checksum support via IEEE CRC-32. A sample implementation is provided, but it is expected that most devices have optimized implementations available or may prefer implementations with alternate optimization criteria
105*84e33947SAndroid Build Coastguard Worker  - Timesync functionality and timestamp offset correction for WiFi and WWAN measurements
106*84e33947SAndroid Build Coastguard Worker  - Reset handling throughout the transport layer, clients, and services, opening and recovering state as needed
107*84e33947SAndroid Build Coastguard Worker  - WiFi RTT client and service support
108*84e33947SAndroid Build Coastguard Worker  - Multiple loopback client support
109*84e33947SAndroid Build Coastguard Worker  - Transport-layer-loopback client validates response and returns the result
110*84e33947SAndroid Build Coastguard Worker  - Support for pseudo-opening services at the client, so they appear always available
111*84e33947SAndroid Build Coastguard Worker  - Correct responses generated at clients when async requests fail at services
112*84e33947SAndroid Build Coastguard Worker
113*84e33947SAndroid Build Coastguard Worker- Cleanup and bug fixes
114*84e33947SAndroid Build Coastguard Worker
115*84e33947SAndroid Build Coastguard Worker  - Client and service fixes including length and bound checks, missing implementations
116*84e33947SAndroid Build Coastguard Worker  - Parser fixes including empty pointers set to null, compatibility with processors lacking unaligned access support
117*84e33947SAndroid Build Coastguard Worker  - Stability fixes throughout CHPP and tests
118*84e33947SAndroid Build Coastguard Worker  - Improved compiler compatibility for C99+ and pre-C99 systems (even though CHPP does not officially support pre-C99)
119*84e33947SAndroid Build Coastguard Worker  - Updated documentation and logging
120*84e33947SAndroid Build Coastguard Worker
121*84e33947SAndroid Build Coastguard Worker### 2021-03-25 (f908420)
122*84e33947SAndroid Build Coastguard Worker
123*84e33947SAndroid Build Coastguard WorkerThis release updates the built-in timesync and checksum functionality and addresses bugs and compatibility issues.
124*84e33947SAndroid Build Coastguard Worker
125*84e33947SAndroid Build Coastguard Worker- Updated functionality
126*84e33947SAndroid Build Coastguard Worker
127*84e33947SAndroid Build Coastguard Worker  - Timesync is redesigned to become non-blocking
128*84e33947SAndroid Build Coastguard Worker  - Outgoing checksums are enabled by default
129*84e33947SAndroid Build Coastguard Worker  - An updated sample CRC32 implementation is provided (It is still expected that devices that have existing, optimized implementations use their own)
130*84e33947SAndroid Build Coastguard Worker  - Client deinitialization and reset support
131*84e33947SAndroid Build Coastguard Worker
132*84e33947SAndroid Build Coastguard Worker- Cleanup and bug fixes
133*84e33947SAndroid Build Coastguard Worker
134*84e33947SAndroid Build Coastguard Worker  - Logging updates, including reset reasoning, avoiding %s for compatibility
135*84e33947SAndroid Build Coastguard Worker  - Stability fixes and cleanup throughout CHPP and tests, including the reopening flow, permanent_failure state, and a memory leak
136*84e33947SAndroid Build Coastguard Worker  - Testing improvements
137*84e33947SAndroid Build Coastguard Worker
138*84e33947SAndroid Build Coastguard Worker### 2021-05-24 (c9bfae3)
139*84e33947SAndroid Build Coastguard Worker
140*84e33947SAndroid Build Coastguard WorkerThis release enables better identification of end-of-packets as well as addressing bugs and compatibility issues.
141*84e33947SAndroid Build Coastguard Worker
142*84e33947SAndroid Build Coastguard Worker- Updated functionality
143*84e33947SAndroid Build Coastguard Worker
144*84e33947SAndroid Build Coastguard Worker  - Rx timeout detection
145*84e33947SAndroid Build Coastguard Worker  - Rx MTU enforcement
146*84e33947SAndroid Build Coastguard Worker  - Support for Rx end-of-packet notifications from the link layer (optional, platform dependent)
147*84e33947SAndroid Build Coastguard Worker
148*84e33947SAndroid Build Coastguard Worker- Cleanup and bug fixes
149*84e33947SAndroid Build Coastguard Worker
150*84e33947SAndroid Build Coastguard Worker  - Reset functionality cleanup, including updating the functionality of CHPP_TRANSPORT_MAX_RETX and CHPP_TRANSPORT_MAX_RESET to reflect their intent accurately
151*84e33947SAndroid Build Coastguard Worker  - Pseudo-open clients remain pseudo-open after open failures
152*84e33947SAndroid Build Coastguard Worker  - Fixed reopen failures after transport reset
153*84e33947SAndroid Build Coastguard Worker  - Added missing WiFi ranging service response
154*84e33947SAndroid Build Coastguard Worker  - Memory allocation and initialization improvements
155*84e33947SAndroid Build Coastguard Worker  - Mutex handling improvements
156*84e33947SAndroid Build Coastguard Worker  - Compatibility fixes
157*84e33947SAndroid Build Coastguard Worker  - Testing improvements
158*84e33947SAndroid Build Coastguard Worker
159*84e33947SAndroid Build Coastguard Worker### 2021-06-17 (this)
160*84e33947SAndroid Build Coastguard Worker
161*84e33947SAndroid Build Coastguard WorkerThis release adds request timeout support at the client and addresses several bugs and compatibility issues throughout CHPP, including fixing open-state tracking at the service. Note that with the corrected open-state tracking, it is essential for services to correctly implement the close() PAL API so that it disables any ongoing requests and returns to a clean state.
162*84e33947SAndroid Build Coastguard Worker
163*84e33947SAndroid Build Coastguard Worker- Updated functionality
164*84e33947SAndroid Build Coastguard Worker
165*84e33947SAndroid Build Coastguard Worker  - Client request timeout support
166*84e33947SAndroid Build Coastguard Worker
167*84e33947SAndroid Build Coastguard Worker- Cleanup and bug fixes
168*84e33947SAndroid Build Coastguard Worker
169*84e33947SAndroid Build Coastguard Worker  - Service open-state tracking
170*84e33947SAndroid Build Coastguard Worker  - Memory handling fixes
171*84e33947SAndroid Build Coastguard Worker  - Added GNSS passive location listener service response
172*84e33947SAndroid Build Coastguard Worker  - Enforced error code requirements on service responses
173*84e33947SAndroid Build Coastguard Worker  - Fixed ARQ handling of duplicate packets
174*84e33947SAndroid Build Coastguard Worker  - Client request/response state refactoring
175*84e33947SAndroid Build Coastguard Worker  - Client registration cleanup
176*84e33947SAndroid Build Coastguard Worker  - Reset handling fixes
177*84e33947SAndroid Build Coastguard Worker  - Testing improvements
178*84e33947SAndroid Build Coastguard Worker
179*84e33947SAndroid Build Coastguard Worker### 2023-01
180*84e33947SAndroid Build Coastguard Worker
181*84e33947SAndroid Build Coastguard WorkerUpdate CHPP to make it possible to use different link layers on the same platform.
182*84e33947SAndroid Build Coastguard Worker
183*84e33947SAndroid Build Coastguard Worker**Before:**
184*84e33947SAndroid Build Coastguard Worker
185*84e33947SAndroid Build Coastguard WorkerThe link layer API is defined by:
186*84e33947SAndroid Build Coastguard Worker
187*84e33947SAndroid Build Coastguard Worker- A few global functions:
188*84e33947SAndroid Build Coastguard Worker  - `chppPlatformLinkInit`
189*84e33947SAndroid Build Coastguard Worker  - `chppPlatformLinkDeinit`
190*84e33947SAndroid Build Coastguard Worker  - `chppPlatformLinkSend`
191*84e33947SAndroid Build Coastguard Worker  - `chppPlatformLinkDoWork`
192*84e33947SAndroid Build Coastguard Worker  - `chppPlatformLinkReset`
193*84e33947SAndroid Build Coastguard Worker
194*84e33947SAndroid Build Coastguard Worker- A few defines:
195*84e33947SAndroid Build Coastguard Worker  - `CHPP_PLATFORM_LINK_TX_MTU_BYTES`
196*84e33947SAndroid Build Coastguard Worker  - `CHPP_PLATFORM_LINK_RX_MTU_BYTES`
197*84e33947SAndroid Build Coastguard Worker  - `CHPP_PLATFORM_TRANSPORT_TIMEOUT_MS`
198*84e33947SAndroid Build Coastguard Worker
199*84e33947SAndroid Build Coastguard Worker**After:**
200*84e33947SAndroid Build Coastguard Worker
201*84e33947SAndroid Build Coastguard WorkerIn order to be able to use different link layers, the link layer API is now defined by
202*84e33947SAndroid Build Coastguard Worker
203*84e33947SAndroid Build Coastguard Worker- A `ChppLinkApi` API struct composed of pointers to the entry points:
204*84e33947SAndroid Build Coastguard Worker  - `init`
205*84e33947SAndroid Build Coastguard Worker  - `deinit`
206*84e33947SAndroid Build Coastguard Worker  - `send`
207*84e33947SAndroid Build Coastguard Worker  - `doWork`
208*84e33947SAndroid Build Coastguard Worker  - `reset`
209*84e33947SAndroid Build Coastguard Worker  - `getConfig` [added]
210*84e33947SAndroid Build Coastguard Worker  - `getTxBuffer` [added]
211*84e33947SAndroid Build Coastguard Worker- A free form state,
212*84e33947SAndroid Build Coastguard Worker- A `ChppLinkConfiguration` struct replacing the former defines.
213*84e33947SAndroid Build Coastguard Worker
214*84e33947SAndroid Build Coastguard Worker#### Migration
215*84e33947SAndroid Build Coastguard Worker
216*84e33947SAndroid Build Coastguard WorkerYou first need to create a `struct` holding the state of the link layer.
217*84e33947SAndroid Build Coastguard WorkerThis state `struct` is free form but would usually contain:
218*84e33947SAndroid Build Coastguard Worker- The TX buffer - it was owned by the transport layer in the previous version.
219*84e33947SAndroid Build Coastguard Worker  The TX buffer size must be added to the configuration `ChppLinkConfiguration` struct.
220*84e33947SAndroid Build Coastguard Worker  You can compute the size from your former `CHPP_PLATFORM_LINK_TX_MTU_BYTES`.
221*84e33947SAndroid Build Coastguard Worker  The formula to use is `min(CHPP_PLATFORM_LINK_TX_MTU_BYTES, 1024) + CHPP_TRANSPORT_ENCODING_OVERHEAD_BYTES`.
222*84e33947SAndroid Build Coastguard Worker  For example if your `CHPP_PLATFORM_LINK_TX_MTU_BYTES` was 2048, the TX buffer size should be `1024 + CHPP_TRANSPORT_ENCODING_OVERHEAD_BYTES`.
223*84e33947SAndroid Build Coastguard Worker  Note that 1024 (or whatever the value of the min is) is the effective payload.
224*84e33947SAndroid Build Coastguard Worker  The TX buffer will be slightly larger to accommodate the transport layer encoding overhead.
225*84e33947SAndroid Build Coastguard Worker- A pointer to the transport layer state which is required for the transport layer callbacks
226*84e33947SAndroid Build Coastguard Worker
227*84e33947SAndroid Build Coastguard WorkerYou need to create an instance of `ChppLinkApi` with pointers to the link functions.
228*84e33947SAndroid Build Coastguard WorkerThe API of the existing function have changed. They now take a `void *` pointer to the free form link state where they used to take a `struct ChppPlatformLinkParameters *`. You should cast that `void* linkContext` pointer to the type of your free form state.
229*84e33947SAndroid Build Coastguard Worker
230*84e33947SAndroid Build Coastguard WorkerThe `init` function now takes a second `struct ChppTransportState *transportContext` parameter. That function should store it in the state as it will be needed later to callback into the transport layer. The `init` function might store the `ChppLinkConfiguration` configuration in the state (if the configuration varies across link layer instances).
231*84e33947SAndroid Build Coastguard Worker
232*84e33947SAndroid Build Coastguard WorkerThe `send` function does not take a pointer to the TX buffer (`uint8_t *buf`) any more. That's because this buffer is now owned by the link layer and part of the link state.
233*84e33947SAndroid Build Coastguard Worker
234*84e33947SAndroid Build Coastguard WorkerThe added `getConfig` function returns the configuration `ChppLinkConfiguration` struct. The configuration might be shared across link instances or specific to a given instance.
235*84e33947SAndroid Build Coastguard Worker
236*84e33947SAndroid Build Coastguard WorkerThe added `getTxBuffer` function returns a pointer to the TX buffer that is part in the state.
237*84e33947SAndroid Build Coastguard Worker
238*84e33947SAndroid Build Coastguard WorkerThen you need to create the `ChppLinkConfiguration` struct. It contains the size of TX buffer, the size of the RX buffer. Those are equivalent to the former defines. Note that `CHPP_PLATFORM_TRANSPORT_TIMEOUT_MS` was not used and has been deleted.
239*84e33947SAndroid Build Coastguard Worker
240*84e33947SAndroid Build Coastguard WorkerOther changes:
241*84e33947SAndroid Build Coastguard Worker
242*84e33947SAndroid Build Coastguard Worker- You need to pass the link state and the link `ChppLinkApi` struct when initializing the transport layer with `chppTransportInit`.
243*84e33947SAndroid Build Coastguard Worker- When calling the `chppLinkSendDoneCb` and `chppWorkThreadSignalFromLink` from the link layer the first parameter should now be a pointer to the transport layer. You would typically retrieve that pointer from the link state where you should have stored it in the `init` function.
244*84e33947SAndroid Build Coastguard Worker
245*84e33947SAndroid Build Coastguard Worker### 2023-03
246*84e33947SAndroid Build Coastguard Worker
247*84e33947SAndroid Build Coastguard WorkerThe `chppRegisterService` signature changes from
248*84e33947SAndroid Build Coastguard Worker
249*84e33947SAndroid Build Coastguard Worker```
250*84e33947SAndroid Build Coastguard Workeruint8_t chppRegisterService(struct ChppAppState *appContext,
251*84e33947SAndroid Build Coastguard Worker                            void *serviceContext,
252*84e33947SAndroid Build Coastguard Worker                            const struct ChppService *newService);
253*84e33947SAndroid Build Coastguard Worker```
254*84e33947SAndroid Build Coastguard Worker
255*84e33947SAndroid Build Coastguard Workerto
256*84e33947SAndroid Build Coastguard Worker
257*84e33947SAndroid Build Coastguard Worker```
258*84e33947SAndroid Build Coastguard Workervoid chppRegisterService(struct ChppAppState *appContext, void *serviceContext,
259*84e33947SAndroid Build Coastguard Worker                         struct ChppServiceState *serviceState,
260*84e33947SAndroid Build Coastguard Worker                         const struct ChppService *newService);
261*84e33947SAndroid Build Coastguard Worker```
262*84e33947SAndroid Build Coastguard Worker
263*84e33947SAndroid Build Coastguard WorkerThe handle which used to be returned is now populated in `serviceState`.
264*84e33947SAndroid Build Coastguard Worker`service->appContext` is also initialized to the passed `appContext`.
265*84e33947SAndroid Build Coastguard Worker
266*84e33947SAndroid Build Coastguard WorkerThis change makes the signature and behavior consistent with `chreRegisterClient`.
267*84e33947SAndroid Build Coastguard Worker
268*84e33947SAndroid Build Coastguard Worker### 2023-08
269*84e33947SAndroid Build Coastguard Worker
270*84e33947SAndroid Build Coastguard WorkerServices can now send requests and receive responses from clients.
271*84e33947SAndroid Build Coastguard Worker
272*84e33947SAndroid Build Coastguard WorkerThe changes to the public API of the different layers are described below.
273*84e33947SAndroid Build Coastguard WorkerCheck the inline documentation for more information.
274*84e33947SAndroid Build Coastguard Worker
275*84e33947SAndroid Build Coastguard Worker**Breaking changes**
276*84e33947SAndroid Build Coastguard Worker
277*84e33947SAndroid Build Coastguard Worker- `ChppClientState` and `ChppServiceState` have been unified into `ChppEndpointState`.
278*84e33947SAndroid Build Coastguard Worker
279*84e33947SAndroid Build Coastguard Worker#### app.c / app.h
280*84e33947SAndroid Build Coastguard Worker
281*84e33947SAndroid Build Coastguard Worker**Breaking changes**
282*84e33947SAndroid Build Coastguard Worker
283*84e33947SAndroid Build Coastguard Worker- Move all sync primitives to a new `struct ChppSyncResponse`,
284*84e33947SAndroid Build Coastguard Worker- Renamed `ChppClient.rRStateCount` to `ChppClient.outReqCount`. The content and meaning stay the same,
285*84e33947SAndroid Build Coastguard Worker- Split `struct ChppRequestResponseState` to `struct ChppOutgoingRequestState` and `struct ChppIncomingRequestState`. Both the struct have the same layout and usage as the former `struct`. Having different types is only to make code clearer as both clients and services now support both incoming and outgoing requests,
286*84e33947SAndroid Build Coastguard Worker- Renamed `ChppAppState.nextClientRequestTimeoutNs` to `ChppAppState.nextRequestTimeoutNs`. The content and meaning stay the same,
287*84e33947SAndroid Build Coastguard Worker- Renamed `CHPP_CLIENT_REQUEST_TIMEOUT_INFINITE` to `CHPP_REQUEST_TIMEOUT_INFINITE`.
288*84e33947SAndroid Build Coastguard Worker
289*84e33947SAndroid Build Coastguard Worker**Added APIs**
290*84e33947SAndroid Build Coastguard Worker
291*84e33947SAndroid Build Coastguard Worker- Added `chppAllocResponseTypedArray` and `chppAllocResponseFixed` to allocate responses. Those can be used by both clients and services. They call the added `chppAllocResponse`,
292*84e33947SAndroid Build Coastguard Worker- Added `CHPP_MESSAGE_TYPE_SERVICE_REQUEST` and  `CHPP_MESSAGE_TYPE_CLIENT_RESPONSE` to the message types (`ChppMessageType`). Used for requests sent by the services and the corresponding responses sent by the client,
293*84e33947SAndroid Build Coastguard Worker- Added `ChppService.responseDispatchFunctionPtr` to handle client responses,
294*84e33947SAndroid Build Coastguard Worker- Added `ChppService.outReqCount` holding the number of commands supported by the service (0 when the service can not send requests),
295*84e33947SAndroid Build Coastguard Worker- Added `ChppClient.requestDispatchFunctionPtr` to handle service requests,
296*84e33947SAndroid Build Coastguard Worker- Added `ChppAppState.registeredServiceStates` to track service states,
297*84e33947SAndroid Build Coastguard Worker- Added `ChppAppState.nextServiceRequestTimeoutNs` to track when the next service sent request will timeout,
298*84e33947SAndroid Build Coastguard Worker- Added `chppTimestampIncomingRequest` to be used by both clients and services,
299*84e33947SAndroid Build Coastguard Worker- Added `chppTimestampOutgoingRequest` to be used by both clients and services,
300*84e33947SAndroid Build Coastguard Worker- Added `chppTimestampIncomingResponse` to be used by both clients and services,
301*84e33947SAndroid Build Coastguard Worker- Added `chppTimestampOutgoingResponse` to be used by both clients and services,
302*84e33947SAndroid Build Coastguard Worker- Added `chppSendTimestampedResponseOrFail` to be used by both clients and services,
303*84e33947SAndroid Build Coastguard Worker- Added `chppSendTimestampedRequestOrFail` to be used by both clients and services,
304*84e33947SAndroid Build Coastguard Worker- Added `chppWaitForResponseWithTimeout` to be used by both clients and services.
305*84e33947SAndroid Build Coastguard Worker
306*84e33947SAndroid Build Coastguard Worker#### clients.c / clients.h
307*84e33947SAndroid Build Coastguard Worker
308*84e33947SAndroid Build Coastguard Worker**Breaking changes**
309*84e33947SAndroid Build Coastguard Worker
310*84e33947SAndroid Build Coastguard Worker- Renamed `ChppClientState.rRStates` to `outReqStates` - the new type is `ChppOutgoingRequestState`. The content and meaning stay the same,
311*84e33947SAndroid Build Coastguard Worker- Nest all sync primitive in `ChppClientState` into a `struct ChppSyncResponse syncResponse`,
312*84e33947SAndroid Build Coastguard Worker- `chppRegisterClient` takes a `ChppOutgoingRequestState` instead of the former `ChppRequestResponseState`,
313*84e33947SAndroid Build Coastguard Worker- `chppClientTimestampRequest` is replaced with `chppTimestampOutgoingRequest` in the app layer. Parameters are different,
314*84e33947SAndroid Build Coastguard Worker- `chppClientTimestampResponse` is replaced with `chppTimestampIncomingResponse` in the app layer. Parameters are different,
315*84e33947SAndroid Build Coastguard Worker- `chppSendTimestampedRequestOrFail` is renamed to `chppClientSendTimestampedRequestOrFail`. It takes a `ChppOutgoingRequestState` instead of the former `ChppRequestResponseState`,
316*84e33947SAndroid Build Coastguard Worker- `chppSendTimestampedRequestAndWait` is renamed to `chppClientSendTimestampedRequestAndWait`. It takes a `ChppOutgoingRequestState` instead of the former `ChppRequestResponseState`,
317*84e33947SAndroid Build Coastguard Worker- `chppSendTimestampedRequestAndWaitTimeout` is renamed to `chppClientSendTimestampedRequestAndWaitTimeout`. It takes a `ChppOutgoingRequestState` instead of the former `ChppRequestResponseState`,
318*84e33947SAndroid Build Coastguard Worker- `chppClientSendOpenRequest` takes a `ChppOutgoingRequestState` instead of the former `ChppRequestResponseState`.
319*84e33947SAndroid Build Coastguard Worker
320*84e33947SAndroid Build Coastguard Worker#### services.c / services.h
321*84e33947SAndroid Build Coastguard Worker
322*84e33947SAndroid Build Coastguard Worker**Breaking changes**
323*84e33947SAndroid Build Coastguard Worker
324*84e33947SAndroid Build Coastguard Worker- Replaced `chppAllocServiceResponseTypedArray` with `chppAllocResponseTypedArray` in the app layer,
325*84e33947SAndroid Build Coastguard Worker- Replaced `chppAllocServiceResponseFixed` with `chppAllocResponseFixed` in the app layer,
326*84e33947SAndroid Build Coastguard Worker- Replaced `chppAllocServiceResponse` with `chppAllocResponse` in the app layer,
327*84e33947SAndroid Build Coastguard Worker- `chppRegisterService` now takes and additional `struct ChppOutgoingRequestState *` to track outgoing requests. `NULL` when the service do not send requests.
328*84e33947SAndroid Build Coastguard Worker
329*84e33947SAndroid Build Coastguard Worker**Added APIs**
330*84e33947SAndroid Build Coastguard Worker
331*84e33947SAndroid Build Coastguard Worker- Added `chppAllocServiceRequestFixed` and `chppAllocServiceRequestTypedArray` to allocate service requests. They call the added `chppAllocServiceRequest`,
332*84e33947SAndroid Build Coastguard Worker- Added `ChppServiceState.outReqStates` to track outgoing requests,
333*84e33947SAndroid Build Coastguard Worker- Added `ChppServiceState.transaction` to track app layer packet number,
334*84e33947SAndroid Build Coastguard Worker- Added `ChppServiceState.syncResponse` for sync responses,
335*84e33947SAndroid Build Coastguard Worker- Added `chppAllocServiceRequest`,
336*84e33947SAndroid Build Coastguard Worker- Added `chppAllocServiceRequestCommand`,
337*84e33947SAndroid Build Coastguard Worker- Added `chppServiceSendTimestampedRequestOrFail`,
338*84e33947SAndroid Build Coastguard Worker- Added `chppServiceSendTimestampedRequestAndWaitTimeout`,
339*84e33947SAndroid Build Coastguard Worker- Added `chppServiceCloseOpenRequests` to close pending requests on reset.
340