#if C
B4R::Object* tmp = new B4R::Object();
template <typename T>
B4R::Object* respond(int type,T const & value){
tmp->type = type;
switch (type){
case BR_INT:
tmp->data.LongField = (Int)value;
break;
case BR_LONG:
tmp->data.LongField = (Long)value;
break;
case BR_DOUBLE:
tmp->data.DoubleField = (Double)value;
break;
case BR_ULONG:
tmp->data.ULongField = (ULong)value;
break;
case BR_UINT:
tmp->data.ULongField = (UInt)value;
break;
case BR_BOOL:
tmp->data.ULongField = (bool)value;
break;
default:
::Serial.println("Unknown type "+type);
}
return tmp;
}
#End If