[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: SNVT union example in oBIX
Jeremy promised a Lonworks union
example, and I promised a proposal how I would do that in oBIX. For now
let’s assu In this example, a ca typedef
struct{
unsigned long receiver_id;
unsigned long controller_id;
unsigned short controller_prio;
cam_func_t function;
cam_act_t action;
union{
unsigned short number;
struct{
signed long pan;
signed long tilt;
signed long zoom;
} abspos;
} value; }
SNVT_pos_ctrl; In oBIX I would probably model this as three
contracts; let’s assu <obj href="”lon:PosCtrl”> <int na <int na <int na </obj> <obj href="”lon:PredefinedPosCtrl”"
is=”lon:PosCtrl”> <int na </obj> <obj href="”lon:CoordinatePosCtrl”"
is=”lon:PosCtrl”> <int na <int na <int na </obj> I didn’t fill in the max, but easy enough to
do if important. Then I might use those contracts for a ca <obj href="”/So <op na </obj> That’s also probably how you would tackle that
in an OO language like Java or C# too. Bob brought up another excellent point – if I’m
a client how do I know what the possible concrete imple However, I think it very useful to think about how
it could be taken further. In a strongly typed, define everything up
front solution I would probably provide the list of contracts in another
property as a list or an enum. In a looser typed environ Brian |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]