Simple GSM device software


     Once we have created new object of type GSm we can access and modify our mobile phone device. I use this code snipet to test my application:


  GSM04 nextGSM = new GSM04();
           nextGSM.Battery.Type = _03.BatteryType.GSMBatteryTypes.NiCd.ToString();
            
           GSM myGSM = new GSM(null, null);
           
           myGSM.gsmBattery.HoursStandby = 36;
           myGSM.gsmBattery.HoursTalk = 10.5;
           myGSM.gsmBattery.Model = "batt-1223";
           
           myGSM.PhoneManufacturer = "Nokia Corp.";
           myGSM.PhoneModel = "N70";
           myGSM.PhoneOwner = "No One";
           myGSM.PhonePrice = 1000.50m;
and it's working properly. After this we can call our call log or history and add, remove or clear all calls. As provided functionality we can calculate the price of all calls by predefined tax.
GSM testGSM = new GSM(null,null);
                       
            testGSM.phoneCall.DialedPhoneNumber = 0888123456;
            testGSM.phoneCall.CallDuration = 1500;
            Console.WriteLine("Call information:");
            Console.Write("Today {0}, ", testGSM.phoneCall.Date.ToShortDateString());
            Console.Write(" You make a call at {0} ", 
testGSM.phoneCall.Time.ToShortTimeString());
            Console.Write(" and talked to {0} ", testGSM.phoneCall.DialedPhoneNumber);
            Console.Write(" {0} seconds.", testGSM.phoneCall.CallDuration);
            Console.WriteLine();
All classes and full code can be found here.

Няма коментари:

Публикуване на коментар