Commit 1cdc329a authored by Yann Garcia's avatar Yann Garcia

Add MEC simulator

parent 58b15bea
accessPointId,zoneId,connectionType,operationStatus,numberOfUsers,interestRealm,resourceURL
001010000000000000000000000000001,zone01,Macro,Serviceable,5,LA,http://example.com/exampleAPI/location/v1/zones/zone01/accessPoints/ap001
001010000000000000000000000000010,zone01,Macro,Unserviceable,0,DC,http://example.com/exampleAPI/location/v1/zones/zone01/accessPoints/ap002
001010000000000000000000000000011,zone01,Macro,Serviceable,5,NJ,http://example.com/exampleAPI/location/v1/zones/zone01/accessPoints/ap003
002010000000000000000000000000001,zone02,Macro,Serviceable,5,LA,http://example.com/exampleAPI/location/v1/zones/zone02/accessPoints/ap001
002010000000000000000000000000010,zone02,Macro,Unserviceable,0,DC,http://example.com/exampleAPI/location/v1/zones/zone02/accessPoints/ap002
002010000000000000000000000000011,zone02,Macro,Serviceable,5,NJ,http://example.com/exampleAPI/location/v1/zones/zone02/accessPoints/ap003
cellId,appInst,type,address
134217738,appInst01,1,192.0.0.1
134217739,appInst02,1,192.0.0.2
cellId,mcc,mnc,hoStatus,seconds,nanoseconds
134217738,1,1,COMPLETED,1577836800,0
134217739,1,1,COMPLETED,1577836800,0
accessPointId,latitude,longitude,altitude,accuracy
001010000000000000000000000000001,90.123,80.123,10.0,0
001010000000000000000000000000010,91.123,81.123,12.0,1
001010000000000000000000000000011,93.123,83.123,16.0,3
id,address,accessPointId,zoneId,resourceURL,seconds,nanoSeconds,ueTag
toto1,acr:192.0.0.1,001010000000000000000000000000001,zone01,http://example.com/exampleAPI/location/v2/users?address:acr:192.0.0.1,1483231138,0,UeTagA
toto2,acr:192.0.2.2,001010000000000000000000000000001,zone01,http://example.com/exampleAPI/location/v1/users?address:acr:192.0.2.2,1483231138,0,UeTagB
toto3,acr:192.0.2.3,001010000000000000000000000000010,zone01,http://example.com/exampleAPI/location/v1/users?address:acr:192.0.2.3,1483231138,0,UeTagC
toto4,acr:192.0.2.4,001010000000000000000000000000001,zone02,http://example.com/exampleAPI/location/v1/users?address:acr:192.0.2.4,1483231138,0,UeTagD
toto5,acr:192.0.2.5,001010000000000000000000000000010,zone02,http://example.com/exampleAPI/location/v1/users?address:acr:192.0.2.5,1483231138,0,UeTagE
appInst,ueTag,address,state
appInst01,UeTagA,acr:192.0.0.1,UNREGISTERED
appInst01,UeTagC,acr:192.0.0.3,UNREGISTERED
appInst02,UeTagB,acr:192.0.0.2,UNREGISTERED
appInst03,UeTagD,acr:192.0.0.4,UNREGISTERED
appInst03,UeTagE,acr:192.0.0.5,UNREGISTERED
zoneId,numberOfAccessPoints,numberOfUnserviceableAccessPoints,numberOfUsers,resourceURL
zone01,3,1,10,http://example.com/exampleAPI/location/v1/zones/zone01
zone02,12,0,36,http://example.com/exampleAPI/location/v1/zones/zone02
This diff is collapsed.
This diff is collapsed.
# Very basic MEC PLAT simulator
import http.server
import socketserver
import mec_http_server
import threading
import sys, os, time
import msvcrt
# MEC simulator IPv4 address
#ADDRESS_BINDING = '172.28.4.87'
#ADDRESS_BINDING = '192.168.1.21'
ADDRESS_BINDING = '192.168.0.5'
#ADDRESS_BINDING = '127.0.0.1'
# MEC simulator IPv4 listening port
PORT_NUMBER = 8081
# TODO Add Linux support for detecting keyboard input from the terminal?
def getch():
""" Capture keybord entry. """
return msvcrt.getch()
# End of function getch
if __name__ == '__main__':
exit = False
try:
# Create a web server and define the handler to manage the incoming request
server = socketserver.TCPServer((ADDRESS_BINDING, PORT_NUMBER), mec_http_server.myHandler)
print ('Started httpserver on port ' , PORT_NUMBER)
# Wait forever for incoming http requests in background
#server.serve_forever()
threading.Thread(target=server.serve_forever).start()
# Use keybord entries to trigger notifications
while exit == False:
ch = getch()
if ch == b'\x03':
exit = True
else:
print(">>> ch= ", ch)
server.shutdown()
server.socket.close()
except KeyboardInterrupt:
print ('^C received, shutting down the web server')
server.shutdown()
server.socket.close()
# End of __main__
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment