File : sonar.adb


-- Description     : user interface for sonars
-- Author          : Christfried Webers
-- Created On      : Mon Nov  8 20:47:28 1999
-- Last Modified By: .
-- Last Modified On: .
-- Update Count    : 0
-- Status          : Experimental
-------------------------------------------------------------------

with Flex_Common;   use Flex_Common;
with Flex_Driver;
with Sonar_Handler;

package body Sonar is

   procedure Init is
   begin
      Flex_Driver.SerialPort.Init;
      Sonar_Handler.Commander.StartReading;
   end Init;

   procedure Shutdown is
   begin
      Sonar_Handler.Commander.StopReading;
      Sonar_Handler.Reader.NonBlocking;
      Flex_Driver.SerialPort.Shutdown;
   end Shutdown;

   procedure ResumeReading is
   begin
      Sonar_Handler.Commander.StartReading;
   end ResumeReading;

   procedure SuspendReading is
   begin
      Sonar_Handler.Commander.StopReading;
   end SuspendReading;

   procedure GetCurrentStatus (Sonarstatus : out Sonar.Status) is
   begin
      Sonar_Handler.Reader.GetCurrentStatus (SonarStatus);
   end GetCurrentStatus;

   procedure WaitForNewData is
   begin
      Sonar_Handler.Reader.WaitForNewData;
   end WaitForNewData;

end Sonar;