Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jacdac-ts

Package Overview
Dependencies
Maintainers
1
Versions
497
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jacdac-ts - npm Package Compare versions

Comparing version 1.30.8 to 1.30.9

2

package.json
{
"name": "jacdac-ts",
"version": "1.30.8",
"version": "1.30.9",
"description": "JavaScript/TypeScript library to interact with Jacdac devices",

@@ -5,0 +5,0 @@ "keywords": [

@@ -38,4 +38,6 @@ import { Packet } from "./packet"

ControlReg,
SRV_WIFI,
SystemCmd,
SystemReg,
WifiReg,
} from "../../jacdac-spec/dist/specconstants"

@@ -165,2 +167,14 @@ import { jdpack, jdunpack } from "./pack"

function toIP(buffer: Uint8Array): string {
if (!buffer) return undefined
if (buffer.length === 4)
return `${buffer[0]}.${buffer[1]}.${buffer[2]}.${buffer[3]}`
else return toHex(buffer, ".")
}
function toMAC(buffer: Uint8Array) {
const hex = toHex(buffer, ":")
return hex
}
export function decodeMember(

@@ -186,3 +200,19 @@ service: jdspec.ServiceSpec,

if (member.isFloat && (size == 4 || size == 8)) {
if (
service?.classIdentifier === SRV_WIFI &&
pktInfo.kind === "ro" &&
pktInfo.identifier === WifiReg.IpAddress &&
offset == 0
) {
value = pkt.data
humanValue = toIP(pkt.data)
} else if (
service?.classIdentifier === SRV_WIFI &&
pktInfo.kind === "const" &&
pktInfo.identifier === WifiReg.Eui48 &&
offset == 0
) {
value = pkt.data
humanValue = toMAC(pkt.data)
} else if (member.isFloat && (size == 4 || size == 8)) {
if (size == 4) numValue = pkt.getNumber(NumberFormat.Float32LE, offset)

@@ -189,0 +219,0 @@ else numValue = pkt.getNumber(NumberFormat.Float64LE, offset)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc