|
2 | 2 | -- SendLocation common module |
3 | 3 | --------------------------------------------------------------------------------------------------- |
4 | 4 | --[[ General configuration parameters ]] |
5 | | -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" |
| 5 | +config.mobileHost = "127.0.0.1" |
6 | 6 | config.defaultProtocolVersion = 2 |
7 | 7 |
|
8 | 8 | --[[ Required Shared libraries ]] |
@@ -50,8 +50,14 @@ local function getAvailableParams() |
50 | 50 | end |
51 | 51 |
|
52 | 52 | local function allowSDL(self) |
53 | | - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", |
54 | | - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) |
| 53 | + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { |
| 54 | + allowed = true, |
| 55 | + source = "GUI", |
| 56 | + device = { |
| 57 | + id = commonSendLocation.getDeviceMAC(), |
| 58 | + name = commonSendLocation.getDeviceName() |
| 59 | + } |
| 60 | + }) |
55 | 61 | end |
56 | 62 |
|
57 | 63 | local function checkIfPTSIsSentAsBinary(bin_data) |
@@ -181,8 +187,16 @@ function commonSendLocation.delayedExp(timeout) |
181 | 187 | commonTestCases:DelayedExp(timeout) |
182 | 188 | end |
183 | 189 |
|
| 190 | +function commonSendLocation.getDeviceName() |
| 191 | + return config.mobileHost .. ":" .. config.mobilePort |
| 192 | +end |
| 193 | + |
184 | 194 | function commonSendLocation.getDeviceMAC() |
185 | | - return config.deviceMAC |
| 195 | + local cmd = "echo -n " .. commonSendLocation.getDeviceName() .. " | sha256sum | awk '{printf $1}'" |
| 196 | + local handle = io.popen(cmd) |
| 197 | + local result = handle:read("*a") |
| 198 | + handle:close() |
| 199 | + return result |
186 | 200 | end |
187 | 201 |
|
188 | 202 | function commonSendLocation.getSelfAndParams(...) |
|
0 commit comments