Messageport named hardware not working

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Post Reply
Message
Author
User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Messageport named hardware not working

#1 Post by jph »

HI @Corjan

'named' hardware not working in messageport.

using this code - then selecting the appropriate device in the pull down options - as in - the mega2560, unit A - will not work.
.

Code: Select all

-- This function will be called when a message is received from the Arduino.
function new_message(id, payload)
  print("received new message with id " .. id)
end

id = hw_message_port_add("My message port", new_message)
-- You can also send messages to the Arduino
-- In this case a message with id 777 with 3 bytes (0x01, 0x02, 0x03)
hw_message_port_send(id, 100, "BYTE[3]", { 1, 2, 3 })
whereas pre-defining the device will work.
.

Code: Select all

-- This function will be called when a message is received from the Arduino.
function new_message(id, payload)
  print("received new message with id " .. id)
end

id = hw_message_port_add("ARDUINO_MEGA2560_A", new_message)
-- You can also send messages to the Arduino
-- In this case a message with id 777 with 3 bytes (0x01, 0x02, 0x03)
hw_message_port_send(id, 100, "BYTE[3]", { 1, 2, 3 })
.
.
.
Also, just for info, the code on the link here -
https://siminnovations.com/wiki/index.p ... e_port_add
is incorrect
The line -

Code: Select all

hw_message_port_send(id, 777, [ 1, 2, 3 ])
is incorrect and should read -

Code: Select all

hw_message_port_send ( id,  777, "BYTE[3]",  { 1, 2, 3  }  )
It would be REALLY useful to be able to use named hardware.
Thanks
Joe
Joe. CISSP, MSc.

User avatar
samburner3
Posts: 16
Joined: Thu Apr 16, 2020 9:29 am
Location: Australia

Re: Messageport named hardware not working

#2 Post by samburner3 »

I have noticed the above also.

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Messageport named hardware not working

#3 Post by Ralph »

It's on the todo list for the upcoming release.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Messageport named hardware not working

#4 Post by jph »

Excellent, thanks guys.
Appreciated.
Joe

There are a few other things. I will try to post them as best I can in individual threads.
Joe. CISSP, MSc.

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: Messageport named hardware not working

#5 Post by Corjan »

Hi,


Fixed and will be part of upcoming release. Probably in about 2 weeks from now.


Corjan

Post Reply