module(...,package.seeall)
require"lbsloc"

--ǷѯGPSλַϢ
local qryaddr

--[[
print
  ӡӿڣļедӡtestǰ׺
  
ֵ
]]
local function print(...)
	_G.print("test",...)
end

--[[
qrygps
  ѯGPSλ
  
ֵ
]]
local function qrygps()
	qryaddr = not qryaddr
	lbsloc.request(getgps,qryaddr)
end

--[[
getgps
  ȡγȺĻص
  
		resultnumberͣȡ0ʾɹʾʧܡ˽Ϊ0ʱ5
		latstringͣγȣ3λС7λ031.2425864
		lngstringͣȣ3λС7λ121.4736522
		addrstringͣGB2312λַlbsloc.requestѯγȣĵڶΪtrueʱŷر
		latdmstringͣγȣȷָʽ5λС6λdddmm.mmmmmm03114.555184
		lngdmstringͣγȣȷָʽ5λС6λdddmm.mmmmmm12128.419132
ֵ
]]
function getgps(result,lat,lng,addr,latdm,lngdm)
	print("getgps",result,lat,lng,addr,latdm,lngdm)
	--ȡγȳɹ
	if result==0 then
	--ʧ
	else
	end
	sys.timer_start(qrygps,20000)
end

--20ȥѯγȣѯͨصgetgps
sys.timer_start(qrygps,20000)
