Exemple #1
0
        /// <summary>
        /// Initialize connection
        /// </summary>
        public DataPointService(Credentials credentials, string projectName, string hubId, int intervalMilliseconds)
        {
            // Configure Internet connection
            byte[] mac      = { 0x00, 0x26, 0x1C, 0x7B, 0x29, 0xE8 };
            string hostname = "idiotsdk";

            WIZnet_W5100.Enable(SPI.SPI_module.SPI1, (Cpu.Pin)FEZ_Pin.Digital.Di10, (Cpu.Pin)FEZ_Pin.Digital.Di7, true);
            Dhcp.EnableDhcp(mac, hostname);
            Dhcp.RenewDhcpLease();

            // Set current time
            NTPTime("pool.ntp.org");

            // Set interval between requests
            this.RequestInterval = intervalMilliseconds;

            this.username    = credentials.Username;
            this.credentials = credentials;
            this.projectName = projectName;
            this.hubId       = hubId;

            // TODO: Display info on screen module
        }