I2C: Provide byte[] JNI interfaces.

This avoids a direct byte buffer allocation on every read/write/transaction
on the byte[] variants.

Changes HAL I2C interfaces to use const for dataToSend.
This commit is contained in:
Peter Johnson
2017-11-15 21:41:58 -08:00
parent 6307d41002
commit 9021b37fd2
8 changed files with 161 additions and 58 deletions

View File

@@ -35,7 +35,8 @@ class I2CData {
int32_t RegisterWriteCallback(HAL_BufferCallback callback, void* param);
void CancelWriteCallback(int32_t uid);
void Write(int32_t deviceAddress, uint8_t* dataToSend, int32_t sendSize);
void Write(int32_t deviceAddress, const uint8_t* dataToSend,
int32_t sendSize);
void Read(int32_t deviceAddress, uint8_t* buffer, int32_t count);
void ResetData();