Skip to content

Commit

Permalink
sd: replace unsafe.SliceData call with expression that is still suppo…
Browse files Browse the repository at this point in the history
…rted in older Go versions

Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Jan 22, 2024
1 parent bf647ec commit f33ff5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gatts_sd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit f33ff5c

Please sign in to comment.