From 4c90cf4ab60db0e560452a0d462b871571d28ad4 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Mon, 22 Jan 2024 17:18:19 +0100 Subject: [PATCH] sd: replace unsafe.SliceData call with expression that is still supported in older Go versions Signed-off-by: deadprogram --- gatts_sd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gatts_sd.go b/gatts_sd.go index 5e9852f..602aa24 100644 --- a/gatts_sd.go +++ b/gatts_sd.go @@ -150,7 +150,7 @@ func (c *Characteristic) Write(p []byte) (n int, err error) { } } - errCode := C.sd_ble_gatts_value_set_noescape(C.BLE_CONN_HANDLE_INVALID, c.handle, C.uint16_t(len(p)), unsafe.SliceData(p)) + errCode := C.sd_ble_gatts_value_set_noescape(C.BLE_CONN_HANDLE_INVALID, c.handle, C.uint16_t(len(p)), (*C.uint8_t)(unsafe.Pointer(&p[0]))) if errCode != 0 { return 0, Error(errCode) }