Solved it. I'm removing the listener when there is a match, and I'm not using once anymore.
function get(type, callback) {
var getMessageHandler = function (data) {
if(data.name === type) {
switch (data.name) {
case "rpm":
callback(new RPMEvent(data.value));
break;
case "vss":
callback(new SpeedEvent(data.value));
break;
default:
console.log('Not supported yet.');
break;
}
this.removeListener('dataReceived', getMessageHandler);
} else {
console.log('Collision with listener and get. Not supported yet.');
//Do nothing, let the next thing come in. Will be caught by generalHandler.
}
};
sp.on('dataReceived', getMessageHandler);
//Request value after callback.
sp.requestValueByName(type);
}