The exception is "TypeError: 'memoryview' object doesn't support item assignment". Is this a consequence of a build option? It would be good if people with nRF* boards could paste it and report findings (good and bad).
Code: Select all
radioBuffer = bytearray(256)
mv = memoryview(radioBuffer)
def copyStringToRadioBuffer(s):
l = len(s)
mv[: l] = s.encode('utf8')[: l]
mv[l] = 0
copyStringToRadioBuffer('The quick brown fox\n')
print(radioBuffer)