The middle layer of Smart Home Gateway software