RS485 Code Question

In this example for receiving data via RS485 with an expansion shield, what are they doing with this part of the code?

// receive data
digitalWrite(EN, LOW);//Enable Receiving Data
val = Serial.read();
if (-1 != val) {
if ('A' == val) {
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, LOW);
delay(500);

int ledPin = 13;
int EN = 2;
int val;

void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(EN, OUTPUT);
Serial.begin(19200);
}

void loop()
{
// receive data
digitalWrite(EN, LOW);//Enable Receiving Data
val = Serial.read();
if (-1 != val) {
  if ('A' == val) {
    digitalWrite(ledPin, HIGH);
    delay(500);
    digitalWrite(ledPin, LOW);
    delay(500);
  }
}
}

What's your interpretation?

I don't understand the code yet but the shield or UNO may be waiting for a message to set it to receive mode. I'm not a code guru yet, so I don't understand what this means: ```
if (-1 != val) {
if ('A' == val)

Ok, these are two comparison operators.

"==" means "is the expression to the left of the operator equal to the expression on the right?"

"!=" means "is the expression to the left of the operator not equal to the expression on the right?"

are you confused at the order they are compared or in general about the == and !=