diff --git a/libs/core/_locales/core-jsdoc-strings.json b/libs/core/_locales/core-jsdoc-strings.json index 7d9d0fed..1e635ab7 100644 --- a/libs/core/_locales/core-jsdoc-strings.json +++ b/libs/core/_locales/core-jsdoc-strings.json @@ -52,12 +52,14 @@ "Boolean.toString": "Returns a string representation of an object.", "Buffer.fill": "Fill (a fragment) of the buffer with given value.", "Buffer.getNumber": "Read a number in specified format from the buffer.", + "Buffer.getUint8": "Reads an unsigned byte at a particular location", "Buffer.length": "Returns the length of a Buffer object.", "Buffer.rotate": "Rotate buffer left in place.\n\n\n\nstart. eg: -1", "Buffer.rotate|param|length": "number of elements in buffer. If negative, length is set as the buffer length minus", "Buffer.rotate|param|offset": "number of bytes to shift; use negative value to shift right", "Buffer.rotate|param|start": "start offset in buffer. Default is 0.", "Buffer.setNumber": "Write a number in specified format in the buffer.", + "Buffer.setUint8": "Writes an unsigned byte at a particular location", "Buffer.shift": "Shift buffer left in place, with zero padding.\n\n\n\nstart. eg: -1", "Buffer.shift|param|length": "number of elements in buffer. If negative, length is set as the buffer length minus", "Buffer.shift|param|offset": "number of bytes to shift; use negative value to shift right", diff --git a/libs/core/_locales/core-strings.json b/libs/core/_locales/core-strings.json index 4028ef5b..0711efcc 100644 --- a/libs/core/_locales/core-strings.json +++ b/libs/core/_locales/core-strings.json @@ -233,6 +233,7 @@ "String.charAt|block": "char from %this=text|at %pos", "String.compare|block": "compare %this=text| to %that", "String.fromCharCode|block": "text from char code %code", + "String.isEmpty|block": "%this=text| is empty", "String.length|block": "length of %VALUE", "String.substr|block": "substring of %this=text|from %start|of length %length", "String|block": "String", diff --git a/libs/core/shims.d.ts b/libs/core/shims.d.ts index f5bc4595..d7726cef 100644 --- a/libs/core/shims.d.ts +++ b/libs/core/shims.d.ts @@ -884,6 +884,18 @@ declare namespace serial { //% indexerGet=BufferMethods::getByte indexerSet=BufferMethods::setByte declare interface Buffer { + /** + * Reads an unsigned byte at a particular location + */ + //% shim=BufferMethods::getUint8 + getUint8(off: int32): int32; + + /** + * Writes an unsigned byte at a particular location + */ + //% shim=BufferMethods::setUint8 + setUint8(off: int32, v: int32): void; + /** * Write a number in specified format in the buffer. */