Description
The gobindings currently map C char types to Go rune. This is incorrect.
According to the Go specification:
byte alias for uint8
rune alias for int32
C char should be mapped to Go byte (uint8), not rune (int32).
Impact
This mismatch leads to incorrect behavior and can cause crashes when interacting with devices.
Reproduction Example
Using the current mapping:
// This crashes the master brick
func (device *RS232Bricklet) Write(message [60]rune, length uint8) (written uint8, err error) {
Using the correct mapping:
// This works as expected
func (device *RS232Bricklet) Write(message [60]byte, length uint8) (written uint8, err error) {
This issue specifically affects functions like RS232Bricklet.Write() but may impact other bindings where char arrays are used.
Description
The gobindings currently map C char types to Go rune. This is incorrect.
According to the Go specification:
C char should be mapped to Go
byte(uint8), notrune(int32).Impact
This mismatch leads to incorrect behavior and can cause crashes when interacting with devices.
Reproduction Example
Using the current mapping:
Using the correct mapping:
This issue specifically affects functions like RS232Bricklet.Write() but may impact other bindings where char arrays are used.