Mini Kabibi Habibi
local Protocol = {};
-- ��ʾ�ֵ������16��10����(��Сֵ�����ֵ)
Protocol.Attr =
{
-- Э�����ʾ���,���ܳ���16�ַ���Ŀǰ�ݲ�֧������
Name = "PANASONIC",
-- ָ�����̨Э�黹�Ǿ���Э�飬ʹ��"PTZ", "MATRIX"��ʾ
Type = "PTZ",
-- ��msΪ��λ
Internal = 200,
-- û�ж�Ӧ�ĵ�ַ��Χ���붼���0xff
-- ��̨��ַ��Χ--
CamAddrRange = {1, 99},
-- ���ӵ�ַ��Χ--
MonAddrRange = {1, 96},
-- Ԥ�õ㷶Χ--
PresetRange = {0xff, 0xff},
-- �Զ�Ѳ����·��Χ
TourRange = {0xff, 0xff},
-- �켣��·��Χ
PatternRange = {0x01, 0x3f},
-- ��ֱ�ٶȷ�Χ--
TileSpeedRange = {0x00, 0x07},
-- ˮƽ�ٶȷ�Χ--
PanSpeedRange = {0x00, 0x07},
-- �����Χ
AuxRange = {0x01, 0x04},
}
Protocol.CommandAttr =
{
-- Э������Ҫ���ĵ�λ�ã���LUA�±��ʾ�����±�ӣ���ʼ,��10���Ʊ�ʾ
AddrPos = 4,
PresetPos = 23,
TileSpeedPos = 24,
PanSpeedPos = 23,
AuxPos = 6,
}
Protocol.Command =
{
-- д����Э��ʱֻ����16���ƻ��ַ���ʾ,û�еĻ���ע�͵�
Start=
{
--д��������, ���ϣ����£����ϣ�����
TileUp = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', 'F', ':', '2', '0', '2', '1', '3', '6', 'A', ':', '2', '0', '2', '2', 'X', 'Y', '0', 0x03",
TileDown = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', 'F', ':', '2', '0', '2', '1', '3', '6', 'E', ':', '2', '0', '2', '2', 'X', 'Y', '0', 0x03",
PanLeft = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', 'F', ':', '2', '0', '2', '1', '3', '6', '8', ':', '2', '0', '2', '2', 'X', 'Y', '0', 0x03",
PanRight = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', 'F', ':', '2', '0', '2', '1', '3', '6', 'C', ':', '2', '0', '2', '2', 'X', 'Y', '0', 0x03",
LeftUp = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', 'F', ':', '2', '0', '2', '1', '3', '6', '9', ':', '2', '0', '2', '2', 'X', 'Y', '0', 0x03",
LeftDown = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', 'F', ':', '2', '0', '2', '1', '3', '6', 'F', ':', '2', '0', '2', '2', 'X', 'Y', '0', 0x03",
RightUp = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', 'F', ':', '2', '0', '2', '1', '3', '6', 'B', ':', '2', '0', '2', '2', 'X', 'Y', '0', 0x03",
RightDown = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', 'F', ':', '2', '0', '2', '1', '3', '6', 'D', ':', '2', '0', '2', '2', 'X', 'Y', '0', 0x03",
ZoomWide = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '2', '2', 'C', 0x03",
ZoomTele = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '2', '2', '8', 0x03",
FocusNear = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '2', '2', 'E', 0x03",
FocusFar = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '2', '2', 'A', 0x03",
IrisSmall = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '0', '0', '2', '1', '0', '0', '3', 0x03",
IrisLarge = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '0', '0', '2', '1', '0', '0', '2', 0x03",
AutoPanOn = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '3', '0', '0', 0x03 ",
AutoPanOff = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '3', '0', '1', 0x03 ",
},
Stop =
{
TileUp = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '3', '2', '4', 0x03",
TileDown = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '3', '2', '4', 0x03",
PanLeft = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '3', '2', '4', 0x03",
PanRight = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '3', '2', '4', 0x03",
LeftUp = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '3', '2', '4', 0x03",
LeftDown = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '3', '2', '4', 0x03",
RightUp = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '3', '2', '4', 0x03",
RightDown = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '3', '2', '4', 0x03",
ZoomWide = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '2', '2', '4', 0x03",
ZoomTele = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '2', '2', '4', 0x03",
FocusNear = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '2', '2', '4', 0x03",
FocusFar = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '2', '0', '2', '1', '2', '2', '4', 0x03",
IrisSmall = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '0', '0', '2', '1', '0', '0', '4', 0x03",
IrisLarge = "0x02, 'A', 'D', '0', '0', ';', 'G', 'C', '7', ':', '0', '0', '2', '1', '0', '0', '4', 0x03",
},
}
Protocol.Checksum = function (s)
return s;
end;
Protocol.CamAddrProcess = function(s, addr)
local newaddr = math.mod(addr, 100);
local i = math.floor(newaddr/10);
local j = math.mod(newaddr, 10);
s[Protocol.CommandAttr.AddrPos] = i + 0x30;
s[Protocol.CommandAttr.AddrPos + 1] = j + 0x30;
return s;
end;
Protocol.SpeedProcess = function(s, ver, hor)
if table.getn(s) > 18 then
s[Protocol.CommandAttr.TileSpeedPos] = ver + 0x30;
s[Protocol.CommandAttr.PanSpeedPos] = hor + 0x30;
end;
return s;
end;
return Protocol;