From 426e49351d8f1c2aa2e20fa0a7e5863b66926ce6 Mon Sep 17 00:00:00 2001 From: Philipp Trulson Date: Thu, 17 Oct 2024 23:06:54 +0200 Subject: [PATCH] Set BAT_INDEX as `uint16` in example code --- rscp/request.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rscp/request.go b/rscp/request.go index a3b50ff..82214d6 100644 --- a/rscp/request.go +++ b/rscp/request.go @@ -31,7 +31,7 @@ func validateRequests(messages []Message) error { // // CreateRequest(INFO_REQ_UTC_TIME) // CreateRequest(EMS_REQ_SET_ERROR_BUZZER_ENABLED, true) -// CreateRequest(BAT_REQ_DATA, BAT_INDEX, 0, BAT_REQ_DEVICE_STATE, BAT_REQ_RSOC, BAT_REQ_STATUS_CODE) +// CreateRequest(BAT_REQ_DATA, BAT_INDEX, uint16(0), BAT_REQ_DEVICE_STATE, BAT_REQ_RSOC, BAT_REQ_STATUS_CODE) func CreateRequest(values ...interface{}) (msg *Message, err error) { if msg, err = readRequestSlice(values); err != nil { return nil, err @@ -45,7 +45,7 @@ func CreateRequest(values ...interface{}) (msg *Message, err error) { // // CreateRequests([]interface{}{INFO_REQ_UTC_TIME}) // CreateRequests([]interface{}{EMS_REQ_SET_ERROR_BUZZER_ENABLED, true}) -// CreateRequests([]interface{}{BAT_REQ_DATA, BAT_INDEX, 0, BAT_REQ_DEVICE_STATE, BAT_REQ_RSOC, BAT_REQ_STATUS_CODE}) +// CreateRequests([]interface{}{BAT_REQ_DATA, BAT_INDEX, uint16(0), BAT_REQ_DEVICE_STATE, BAT_REQ_RSOC, BAT_REQ_STATUS_CODE}) func CreateRequests(values ...[]interface{}) ([]Message, error) { if len(values) == 0 { return nil, ErrNoArguments